diff --git a/interface/lib/classes/tform.inc.php b/interface/lib/classes/tform.inc.php index d8d97bf1c3bd4f0c3456434057065c4cafd6c973..b469e2e0276c7c3f214061a7dd2236d48e747642 100644 --- a/interface/lib/classes/tform.inc.php +++ b/interface/lib/classes/tform.inc.php @@ -770,7 +770,7 @@ class tform { break; case 'ISEMAIL': if(function_exists('filter_var')) { - if(!filter_var($field_value, FILTER_VALIDATE_EMAIL)) { + if(filter_var($field_value, FILTER_VALIDATE_EMAIL) === false) { $errmsg = $validator['errmsg']; if(isset($this->wordbook[$errmsg])) { $this->errorMessage .= $this->wordbook[$errmsg]."
\r\n"; @@ -790,17 +790,16 @@ class tform { } break; case 'ISINT': - // Commented out the filter_var part because we do allow 0 - //if(function_exists('filter_var')) { - // if(!filter_var($field_value, FILTER_VALIDATE_INT)) { - // $errmsg = $validator['errmsg']; - // if(isset($this->wordbook[$errmsg])) { - // $this->errorMessage .= $this->wordbook[$errmsg]."
\r\n"; - // } else { - // $this->errorMessage .= $errmsg."
\r\n"; - // } - // } - //} else { + if(function_exists('filter_var')) { + if($field_value != '' && filter_var($field_value, FILTER_VALIDATE_INT) === false) { + $errmsg = $validator['errmsg']; + if(isset($this->wordbook[$errmsg])) { + $this->errorMessage .= $this->wordbook[$errmsg]."
\r\n"; + } else { + $this->errorMessage .= $errmsg."
\r\n"; + } + } + } else { $tmpval = intval($field_value); if($tmpval === 0 and !empty($field_value)) { $errmsg = $validator['errmsg']; @@ -810,7 +809,7 @@ class tform { $this->errorMessage .= $errmsg."
\r\n"; } } - //} + } break; case 'ISPOSITIVE': if(!is_numeric($field_value) || $field_value <= 0){