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

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

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