function _filefield_widget_settings_file_path_validate in FileField 6.3
Same name and namespace in other branches
- 6.2 filefield.module \_filefield_widget_settings_file_path_validate()
1 string reference to '_filefield_widget_settings_file_path_validate'
- filefield_widget_settings_form in ./filefield_widget.inc
- Implementation of CCK's hook_widget_settings($op == 'form').
File
- ./filefield_widget.inc, line 117
- This file contains CCK widget related functionality.
Code
function _filefield_widget_settings_file_path_validate($element, &$form_state) {
$form_state['values']['file_path'] = trim($form_state['values']['file_path'], '\\/');
if (strpos($form_state['values']['file_path'], file_directory_path()) === 0) {
form_error($element, t('The file path (@file_path) cannot start with the system files directory (@files_directory), as this may cause conflicts when building file URLs.', array(
'@file_path' => $form_state['values']['file_path'],
'@files_directory' => file_directory_path(),
)));
}
}