Skip to content

Commit cc2fe48

Browse files
author
fantu
committed
add ip validator in some form
1 parent db81c7c commit cc2fe48

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

interface/web/admin/form/server_config.tform.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
'formtype' => 'TEXT',
7070
'default' => '192.168.0.105',
7171
'validators' => array ( 0 => array ( 'type' => 'ISIPV4',
72-
'errmsg'=> 'ip_address_error_empty'),
72+
'errmsg'=> 'ip_address_error_wrong'),
7373
),
7474
'value' => '',
7575
'width' => '15',
@@ -79,8 +79,8 @@
7979
'datatype' => 'VARCHAR',
8080
'formtype' => 'TEXT',
8181
'default' => '255.255.255.0',
82-
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
83-
'errmsg'=> 'netmask_error_empty'),
82+
'validators' => array ( 0 => array ( 'type' => 'ISIPV4',
83+
'errmsg'=> 'netmask_error_wrong'),
8484
),
8585
'value' => '',
8686
'width' => '15',
@@ -90,8 +90,8 @@
9090
'datatype' => 'VARCHAR',
9191
'formtype' => 'TEXT',
9292
'default' => '192.168.0.1',
93-
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
94-
'errmsg'=> 'gateway_error_empty'),
93+
'validators' => array ( 0 => array ( 'type' => 'ISIPV4',
94+
'errmsg'=> 'gateway_error_wrong'),
9595
),
9696
'value' => '',
9797
'width' => '15',

interface/web/admin/form/server_ip.tform.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,10 @@
9898
'ip_address' => array (
9999
'datatype' => 'VARCHAR',
100100
'formtype' => 'TEXT',
101-
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
102-
'errmsg'=> 'ip_error_empty'),
101+
'validators' => array ( 0 => array ( 'type' => 'ISIPV4',
102+
'errmsg'=> 'ip_error_wrong'),
103103
1 => array ( 'type' => 'UNIQUE',
104104
'errmsg'=> 'ip_error_unique'),
105-
2 => array ( 'type' => 'REGEX',
106-
'regex' => '/^[0-9\.]{7,15}$/',
107-
'errmsg'=> 'ip_err'),
108105
),
109106
'default' => '',
110107
'value' => '',

0 commit comments

Comments
 (0)