function _cas_roles_preg_validate in CAS roles 6
Same name and namespace in other branches
- 8 cas_roles.admin.inc \_cas_roles_preg_validate()
- 7.2 cas_roles.module \_cas_roles_preg_validate()
- 7 cas_roles.module \_cas_roles_preg_validate()
Validate the regular expression field.
1 string reference to '_cas_roles_preg_validate'
- cas_roles_admin_settings in ./
cas_roles.admin.inc - Administrative settings form.
File
- ./
cas_roles.admin.inc, line 89 - Provides settings pages for the CAS Attributes module.
Code
function _cas_roles_preg_validate($element, &$form_state, $form) {
if (!empty($element['#value']) && @preg_match($element['#value'], "CAS") === FALSE) {
form_error($element, t('This field is not a valid preg pattern.'));
}
}