Commit 43922aa6 authored by Falko Timme's avatar Falko Timme
Browse files

- Fixed ISINT check because we do allow 0 (FILTER_VALIDATE_INT doesn't allow 0).

parent 2cb1563f
...@@ -790,16 +790,17 @@ class tform { ...@@ -790,16 +790,17 @@ class tform {
} }
break; break;
case 'ISINT': case 'ISINT':
if(function_exists('filter_var')) { // Commented out the filter_var part because we do allow 0
if(!filter_var($field_value, FILTER_VALIDATE_INT)) { //if(function_exists('filter_var')) {
$errmsg = $validator['errmsg']; // if(!filter_var($field_value, FILTER_VALIDATE_INT)) {
if(isset($this->wordbook[$errmsg])) { // $errmsg = $validator['errmsg'];
$this->errorMessage .= $this->wordbook[$errmsg]."<br />\r\n"; // if(isset($this->wordbook[$errmsg])) {
} else { // $this->errorMessage .= $this->wordbook[$errmsg]."<br />\r\n";
$this->errorMessage .= $errmsg."<br />\r\n"; // } else {
} // $this->errorMessage .= $errmsg."<br />\r\n";
} // }
} else { // }
//} else {
$tmpval = intval($field_value); $tmpval = intval($field_value);
if($tmpval === 0 and !empty($field_value)) { if($tmpval === 0 and !empty($field_value)) {
$errmsg = $validator['errmsg']; $errmsg = $validator['errmsg'];
...@@ -809,7 +810,7 @@ class tform { ...@@ -809,7 +810,7 @@ class tform {
$this->errorMessage .= $errmsg."<br />\r\n"; $this->errorMessage .= $errmsg."<br />\r\n";
} }
} }
} //}
break; break;
case 'ISPOSITIVE': case 'ISPOSITIVE':
if(!is_numeric($field_value) || $field_value <= 0){ if(!is_numeric($field_value) || $field_value <= 0){
......
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