function _file_generic_settings_file_directory_validate

Element validate callback for the file destination field.

Remove slashes from the beginning and end of the destination value and ensure that the file directory path is not included at the beginning of the value.

1 string reference to '_file_generic_settings_file_directory_validate'
file_field_instance_settings_form in modules/file/file.field.inc
Implements hook_field_instance_settings_form().

File

modules/file/file.field.inc, line 161

Code

function _file_generic_settings_file_directory_validate($element, &$form_state) {
    // Strip slashes from the beginning and end of $widget['file_directory'].
    $value = trim($element['#value'], '\\/');
    form_set_value($element, $value, $form_state);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.