added DNS names as regex

This commit is contained in:
Roland Gruber 2004-12-29 08:49:09 +00:00
parent a5fe558f13
commit e7f79fbb43
1 changed files with 3 additions and 0 deletions

View File

@ -499,6 +499,9 @@ function get_preg($argument, $regexp) {
case 'sambaLogonHours': case 'sambaLogonHours':
$pregexpr = '/^[0-9a-fA-F]{42}$/'; $pregexpr = '/^[0-9a-fA-F]{42}$/';
break; break;
case 'DNSname':
$pregexpr = '/^[0-9a-zA-Z_-]+(\\.[0-9a-zA-Z_-]+)*$/';
break;
} }
if ($pregexpr!='') if ($pregexpr!='')
if (preg_match($pregexpr, $argument)) { if (preg_match($pregexpr, $argument)) {