You are here

function filebrowser_form_rename_validate in Filebrowser 7.4

Same name and namespace in other branches
  1. 7.3 filebrowser.module \filebrowser_form_rename_validate()

Validate rename form values.

File

./filebrowser.module, line 1049

Code

function filebrowser_form_rename_validate($form, &$form_state) {

  // Do not accept path separators into new file names.
  foreach ($form_state['values']['new_names'] as $fid => $new_name) {
    if (strpos($new_name, '/') !== FALSE || strpos($new_name, "\\") !== FALSE) {
      form_set_error('new_names[' . $fid . ']', t('Invalid filename: :filename', array(
        ':filename' => $new_name,
      )));
    }
  }
}