Commit 3ae3d88a authored by fantu's avatar fantu
Browse files

add ip validator in form system, for now only for ipv4

parent 50b2c3e0
......@@ -630,6 +630,16 @@ class tform {
$this->errorMessage .= $errmsg."<br />\r\n";
}
}
break;
case 'ISIPV4':
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";
} else {
$this->errorMessage .= $errmsg."<br />\r\n";
}
}
break;
case 'CUSTOM':
// Calls a custom class to validate this record
......
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