| | |
| | | $this->errorMessage .= $errmsg."<br />\r\n"; |
| | | } |
| | | } |
| | | break; |
| | | case 'ISEMAIL': |
| | | $error = false; |
| | | if($validator['allowempty'] != 'y') $validator['allowempty'] = 'n'; |
| | | if($validator['allowempty'] == 'y' && $field_value == '') { |
| | | //* Do nothing |
| | | } else { |
| | | if(function_exists('filter_var')) { |
| | | if(filter_var($field_value, FILTER_VALIDATE_EMAIL) === false) { |
| | | $error = true; |
| | | } else { |
| | | if (!preg_match("/^[^\\+]+$/", $field_value)) { // * disallow + in local-part |
| | | $error = true; |
| | | } |
| | | } |
| | | if ($error) { |
| | | $errmsg = $validator['errmsg']; |
| | | if(isset($this->wordbook[$errmsg])) { |
| | | $this->errorMessage .= $this->wordbook[$errmsg]."<br />\r\n"; |
| | |
| | | $this->errorMessage .= $errmsg."<br />\r\n"; |
| | | } |
| | | } |
| | | |
| | | } else $this->errorMessage .= "function filter_var missing <br />\r\n"; |
| | | } |
| | | unset($error); |
| | | break; |
| | | case 'ISINT': |
| | | if(function_exists('filter_var') && $field_value < 2147483647) { |
| | |
| | | break; |
| | | case 'V6PREFIXLENGTH': |
| | | // find shortes ipv6 subnet can`t be longer |
| | | $sql_v6 = $app->db->queryOneRecord("SELECT ip_address FROM server_ip WHERE ip_type = 'IPv6' AND virtualhost = 'y' ORDER BY CHAR_LENGTH(ip_address) ASC LIMIT 0,1;"); |
| | | $sql_v6 = $app->db->queryOneRecord("SELECT ip_address FROM server_ip WHERE ip_type = 'IPv6' AND virtualhost = 'y' ORDER BY CHAR_LENGTH(ip_address) ASC LIMIT 0,1"); |
| | | $sql_v6_explode=explode(':',$sql_v6['ip_address']); |
| | | $explode_field_value = explode(':',$field_value); |
| | | if (count($sql_v6_explode) < count($explode_field_value) && isset($sql_v6['ip_address'])) { |