added ASCII check
This commit is contained in:
parent
b7f90af60d
commit
353cfb5e35
|
@ -474,6 +474,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 'ascii': // ASCII
|
||||||
|
$pregexpr = '/^[' . chr(1) . '-' . chr(128) . ']*$/';
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if ($pregexpr!='')
|
if ($pregexpr!='')
|
||||||
if (preg_match($pregexpr, $argument)) {
|
if (preg_match($pregexpr, $argument)) {
|
||||||
|
|
Loading…
Reference in New Issue