IPv6 check
This commit is contained in:
parent
b7bb54a035
commit
90003744e4
|
@ -565,6 +565,9 @@ function get_preg($argument, $regexp) {
|
||||||
case 'ip': // IP address
|
case 'ip': // IP address
|
||||||
$pregexpr = '/^[0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3}$/';
|
$pregexpr = '/^[0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3}$/';
|
||||||
break;
|
break;
|
||||||
|
case 'ip6': // IPv6 address (only basic check)
|
||||||
|
$pregexpr = '/^[0-9a-f:]+$/i';
|
||||||
|
break;
|
||||||
case 'ascii': // ASCII
|
case 'ascii': // ASCII
|
||||||
$pregexpr = '/^[' . chr(1) . '-' . chr(128) . ']*$/';
|
$pregexpr = '/^[' . chr(1) . '-' . chr(128) . ']*$/';
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue