IPv6 check

This commit is contained in:
Roland Gruber 2013-10-05 14:54:56 +00:00
parent b7bb54a035
commit 90003744e4
1 changed files with 3 additions and 0 deletions

View File

@ -565,6 +565,9 @@ function get_preg($argument, $regexp) {
case 'ip': // IP address
$pregexpr = '/^[0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3}$/';
break;
case 'ip6': // IPv6 address (only basic check)
$pregexpr = '/^[0-9a-f:]+$/i';
break;
case 'ascii': // ASCII
$pregexpr = '/^[' . chr(1) . '-' . chr(128) . ']*$/';
break;