added regex for DNs

This commit is contained in:
Roland Gruber 2005-07-02 12:03:49 +00:00
parent a46462e237
commit e490ec98fb
1 changed files with 3 additions and 0 deletions

View File

@ -511,6 +511,9 @@ function get_preg($argument, $regexp) {
case 'country': // Allow all letters and space case 'country': // Allow all letters and space
$pregexpr = '/^[[:alpha:]]([[:alpha:] ])+$/u'; $pregexpr = '/^[[:alpha:]]([[:alpha:] ])+$/u';
break; break;
case 'dn': // LDAP DN
$pregexpr = '/^([^=,]+=[^=,]+)(,([^=,]+=[^=,]+))*$/';
break;
} }
if ($pregexpr!='') if ($pregexpr!='')
if (preg_match($pregexpr, $argument)) { if (preg_match($pregexpr, $argument)) {