added object class check

This commit is contained in:
Roland Gruber 2012-11-25 11:01:08 +00:00
parent b01abefa88
commit 287bb1fb4b
1 changed files with 4 additions and 1 deletions

View File

@ -499,7 +499,7 @@ function get_preg($argument, $regexp) {
case 'macAddress': case 'macAddress':
$pregexpr = '/^[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}$/'; $pregexpr = '/^[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}$/';
break; break;
case 'date': case 'date': // 31-12-2012
$pregexpr = '/^((0?[1-9])|([1-2][0-9])|30|31)\\-((0?[1-9])|(1[0-2]))\\-[1-3][0-9][0-9][0-9]$/'; $pregexpr = '/^((0?[1-9])|([1-2][0-9])|30|31)\\-((0?[1-9])|(1[0-2]))\\-[1-3][0-9][0-9][0-9]$/';
break; break;
case 'date2': case 'date2':
@ -532,6 +532,9 @@ function get_preg($argument, $regexp) {
case 'ascii': // ASCII case 'ascii': // ASCII
$pregexpr = '/^[' . chr(1) . '-' . chr(128) . ']*$/'; $pregexpr = '/^[' . chr(1) . '-' . chr(128) . ']*$/';
break; break;
case 'objectClass':
$pregexpr = '/^[[:alnum:]_]+$/';
break;
} }
if ($pregexpr!='') if ($pregexpr!='')
if (preg_match($pregexpr, $argument)) { if (preg_match($pregexpr, $argument)) {