Commit 0b6b1e4e authored by fantu's avatar fantu
Browse files

fix in the ip address validator and one test

parent 3ae3d88a
...@@ -632,7 +632,7 @@ class tform { ...@@ -632,7 +632,7 @@ class tform {
} }
break; break;
case 'ISIPV4': case 'ISIPV4':
if(!preg_match("/^[0-9]{1,3}(.)[0-9]{1,3}(.)[0-9]{1,3}(.)[0-9]{1,3}$/", $field_value)) { if(!preg_match("/^[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}$/", $field_value)) {
$errmsg = $validator['errmsg']; $errmsg = $validator['errmsg'];
if(isset($this->wordbook[$errmsg])) { if(isset($this->wordbook[$errmsg])) {
$this->errorMessage .= $this->wordbook[$errmsg]."<br />\r\n"; $this->errorMessage .= $this->wordbook[$errmsg]."<br />\r\n";
......
...@@ -68,7 +68,7 @@ $form["tabs"]['server'] = array ( ...@@ -68,7 +68,7 @@ $form["tabs"]['server'] = array (
'datatype' => 'VARCHAR', 'datatype' => 'VARCHAR',
'formtype' => 'TEXT', 'formtype' => 'TEXT',
'default' => '192.168.0.105', 'default' => '192.168.0.105',
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', 'validators' => array ( 0 => array ( 'type' => 'ISIPV4',
'errmsg'=> 'ip_address_error_empty'), 'errmsg'=> 'ip_address_error_empty'),
), ),
'value' => '', 'value' => '',
......
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