Skip to content

Commit 43922aa

Browse files
committed
- Fixed ISINT check because we do allow 0 (FILTER_VALIDATE_INT doesn't allow 0).
1 parent 2cb1563 commit 43922aa

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

interface/lib/classes/tform.inc.php

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -790,16 +790,17 @@ function validateField($field_name, $field_value, $validators) {
790790
}
791791
break;
792792
case 'ISINT':
793-
if(function_exists('filter_var')) {
794-
if(!filter_var($field_value, FILTER_VALIDATE_INT)) {
795-
$errmsg = $validator['errmsg'];
796-
if(isset($this->wordbook[$errmsg])) {
797-
$this->errorMessage .= $this->wordbook[$errmsg]."<br />\r\n";
798-
} else {
799-
$this->errorMessage .= $errmsg."<br />\r\n";
800-
}
801-
}
802-
} else {
793+
// Commented out the filter_var part because we do allow 0
794+
//if(function_exists('filter_var')) {
795+
// if(!filter_var($field_value, FILTER_VALIDATE_INT)) {
796+
// $errmsg = $validator['errmsg'];
797+
// if(isset($this->wordbook[$errmsg])) {
798+
// $this->errorMessage .= $this->wordbook[$errmsg]."<br />\r\n";
799+
// } else {
800+
// $this->errorMessage .= $errmsg."<br />\r\n";
801+
// }
802+
// }
803+
//} else {
803804
$tmpval = intval($field_value);
804805
if($tmpval === 0 and !empty($field_value)) {
805806
$errmsg = $validator['errmsg'];
@@ -809,7 +810,7 @@ function validateField($field_name, $field_value, $validators) {
809810
$this->errorMessage .= $errmsg."<br />\r\n";
810811
}
811812
}
812-
}
813+
//}
813814
break;
814815
case 'ISPOSITIVE':
815816
if(!is_numeric($field_value) || $field_value <= 0){

0 commit comments

Comments
 (0)