function _file_generic_settings_file_directory_validate

_file_generic_settings_file_directory_validate($element, &$form_state)

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.

File

modules/file/file.field.inc, line 161
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);
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!file!file.field.inc/function/_file_generic_settings_file_directory_validate/7.x