function _file_generic_settings_max_filesize

Render API callback: Validates the maximum upload size field.

Ensures that a size has been entered and that it can be parsed by parse_size().

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

1 string reference to '_file_generic_settings_max_filesize'

File

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

Code

function _file_generic_settings_max_filesize($element, &$form_state) {
  if (!empty($element['#value']) && !is_numeric(parse_size($element['#value']))) {
    form_error($element, t('The "!name" option must contain a valid value. You may either leave the text field empty or enter a string like "512" (bytes), "80 KB" (kilobytes) or "50 MB" (megabytes).', array(
      '!name' => t($element['title']),
    )));
  }
}