Skip to content

Commit

Permalink
Small change to filter logic
Browse files Browse the repository at this point in the history
  • Loading branch information
runz0rd committed Oct 24, 2016
1 parent 0ceb786 commit 2312eab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Common/Util/Validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public static function hasProperty($source, string $propertyName) {
*/
public static function filterInteger($value) {
$intValue = filter_var($value, FILTER_VALIDATE_INT);
if($intValue !== false && !is_bool($value)) {
if($intValue !== false && is_string($value)) {
$value = $intValue;
}

Expand Down Expand Up @@ -103,7 +103,7 @@ public static function filterBoolean($value) {
*/
public static function filterFloat($value) {
$floatValue = filter_var($value, FILTER_VALIDATE_FLOAT);
if($floatValue !== false) {
if($floatValue !== false && is_string($value)) {
$value = $floatValue;
}

Expand Down

0 comments on commit 2312eab

Please sign in to comment.