Commit 20c7c380 authored by tbrehm's avatar tbrehm

Improved IP regex check. Thanks to jdemarchi for the patch.

parent fdb51429
......@@ -100,7 +100,7 @@ $form["tabs"]['dns'] = array (
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
'errmsg'=> 'data_error_empty'),
1 => array ( 'type' => 'REGEX',
'regex' => '/^[0-9\.]{7,15}$/',
'regex' => '/^([1-9]{1}|[1-9]\d|[1]\d\d|2[0-4]\d|25[0-5])\.(\d{1}|[1-9]\d|[1]\d\d|2[0-4]\d|25[0-5])\.(\d{1}|[1-9]\d|[1]\d\d|2[0-4]\d|25[0-5])\.(\d{1}|[1-9]\d|[1]\d\d|2[0-4]\d|25[0-5])$/',
'errmsg'=> 'data_error_regex'),
),
'default' => '',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment