| | |
| | | } |
| | | |
| | | if(substr($field, -1) == '.' && $area == 'Name'){ |
| | | $soa = $app->db->queryOneRecord("SELECT * FROM soa WHERE id = ".intval($zoneid)); |
| | | $soa = $app->db->queryOneRecord("SELECT * FROM soa WHERE id = ?", $zoneid); |
| | | if(substr($field, (strlen($field) - strlen($soa['origin']))) != $soa['origin']) $error .= $desc." ".$app->tform->wordbook['error_out_of_zone']."<br>\r\n"; |
| | | } |
| | | |
| | |
| | | $errmsg = $validator['errmsg']; |
| | | $errorMessage .= $app->tform->lng($errmsg)."<br />\r\n"; |
| | | } |
| | | } else { |
| | | //* Check content with regex, if we use php < 5.2 |
| | | $ip_ok = 0; |
| | | if(preg_match("/^(\:\:([a-f0-9]{1,4}\:){0,6}?[a-f0-9]{0,4}|[a-f0-9]{1,4}(\:[a-f0-9]{1,4}){0,6}?\:\:|[a-f0-9]{1,4}(\:[a-f0-9]{1,4}){1,6}?\:\:([a-f0-9]{1,4}\:){1,6}?[a-f0-9]{1,4})(\/\d{1,3})?$/i", $field_value)){ |
| | | $ip_ok = 1; |
| | | } |
| | | if(preg_match("/^[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}$/", $field_value)){ |
| | | $ip_ok = 1; |
| | | } |
| | | if($ip_ok == 0) { |
| | | $errmsg = $validator['errmsg']; |
| | | $errorMessage .= $app->tform->lng($errmsg)."<br />\r\n"; |
| | | } |
| | | } |
| | | } else $this->errorMessage .= "function filter_var missing <br />\r\n"; |
| | | } |
| | | } |
| | | return $errorMessage; |