function _file_generic_settings_file_directory_validate

Render API callback: Validates the file destination field.

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

This function is assigned as an #element_validate callback in file_field_instance_settings_form().

1 string reference to '_file_generic_settings_file_directory_validate'

File

drupal/core/modules/file/file.field.inc, line 176
Field module functionality for the File module.

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);
}