Skip to content

Commit 20c7c38

Browse files
committed
Improved IP regex check. Thanks to jdemarchi for the patch.
1 parent fdb5142 commit 20c7c38

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

interface/web/dns/form/dns_a.tform.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
101101
'errmsg'=> 'data_error_empty'),
102102
1 => array ( 'type' => 'REGEX',
103-
'regex' => '/^[0-9\.]{7,15}$/',
103+
'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])$/',
104104
'errmsg'=> 'data_error_regex'),
105105
),
106106
'default' => '',

0 commit comments

Comments
 (0)