function rename_admin_paths_form_validate_path_field in Rename Admin Paths 7
Same name and namespace in other branches
- 7.2 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 - Implements hook_menu().
File
- ./
rename_admin_paths.module, line 218 - 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_]+$!', $element['#value'])) {
form_error($element, t('Path replacement value must contain only lowercase letters, numbers, and underscores.'));
}
}