added IP check

This commit is contained in:
Roland Gruber 2010-01-04 17:51:56 +00:00
parent 32121ac142
commit 10b5d8c640
1 changed files with 3 additions and 0 deletions

View File

@ -488,6 +488,9 @@ function get_preg($argument, $regexp) {
break; break;
case 'domainSID': // Samba domain SID case 'domainSID': // Samba domain SID
$pregexpr = "/^S\\-[0-9]\\-[0-9]\\-[0-9]{2,2}\\-[0-9]+\\-[0-9]+\\-[0-9]+$/"; $pregexpr = "/^S\\-[0-9]\\-[0-9]\\-[0-9]{2,2}\\-[0-9]+\\-[0-9]+\\-[0-9]+$/";
case 'ip': // IP address
$pregexpr = '/^[0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3}$/';
break;
} }
if ($pregexpr!='') if ($pregexpr!='')
if (preg_match($pregexpr, $argument)) { if (preg_match($pregexpr, $argument)) {