Commit 0b6b1e4e authored by fantu's avatar fantu

fix in the ip address validator and one test

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