function language_admin_edit_form_validate

Validate the language editing form. Reused for custom language addition too.

1 call to language_admin_edit_form_validate()
language_admin_add_custom_form_validate in drupal/core/modules/language/language.admin.inc
Validate the language addition form on custom language button.
1 string reference to 'language_admin_edit_form_validate'
language_admin_edit_form in drupal/core/modules/language/language.admin.inc
Editing screen for a particular language.

File

drupal/core/modules/language/language.admin.inc, line 336
Administration functions for language.module.

Code

function language_admin_edit_form_validate($form, &$form_state) {

  // Ensure sane field values for langcode and name.
  if (!isset($form['langcode_view']) && preg_match('@[^a-zA-Z_-]@', $form_state['values']['langcode'])) {
    form_set_error('langcode', t('%field may only contain characters a-z, underscores, or hyphens.', array(
      '%field' => $form['langcode']['#title'],
    )));
  }
  if ($form_state['values']['name'] != check_plain($form_state['values']['name'])) {
    form_set_error('name', t('%field cannot contain any markup.', array(
      '%field' => $form['name']['#title'],
    )));
  }
}