You are here

function rename_admin_paths_form_validate_path_field in Rename Admin Paths 7.2

Same name and namespace in other branches
  1. 7 rename_admin_paths.module \rename_admin_paths_form_validate_path_field()

Validation for paths values.

1 string reference to 'rename_admin_paths_form_validate_path_field'
rename_admin_paths_settings in ./rename_admin_paths.module
Settings form().

File

./rename_admin_paths.module, line 243
Allows users to rename admin paths

Code

function rename_admin_paths_form_validate_path_field($element, &$form_state) {

  // Force path replacement values to contain only lowercase letters, numbers, and underscores.
  if (!preg_match('!^[a-z0-9_]+$!i', $element['#value'])) {
    form_error($element, t('Path replacement value must contain only lowercase letters, numbers, and underscores.'));
  }
}