[validation] Return null on invalid number

This commit is contained in:
logmanoriginal 2017-08-06 13:43:23 +02:00
parent 54e8bb2228
commit e4fa963bdf

View file

@ -21,7 +21,7 @@ function validateData(&$data, $parameters){
$validateNumberValue = function($value){ $validateNumberValue = function($value){
$filteredValue = filter_var($value, FILTER_VALIDATE_INT); $filteredValue = filter_var($value, FILTER_VALIDATE_INT);
if($filteredValue === false && !empty($value)) if($filteredValue === false)
return null; return null;
return $filteredValue; return $filteredValue;