Skip to content

Commit

Permalink
Fixes #135 where a validator doesn't know how to handle an int
Browse files Browse the repository at this point in the history
  • Loading branch information
Shardj committed Mar 1, 2021
1 parent 492c137 commit 4695007
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion library/Zend/Validate/Float.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function setLocale($locale = null)
*
* Returns true if and only if $value is a floating-point value
*
* @param string $value
* @param mixed $value
* @return boolean
*/
public function isValid($value)
Expand All @@ -117,6 +117,9 @@ public function isValid($value)

if (is_float($value)) {
return true;
} elseif (is_int($value)) {
$this->_error(self::NOT_FLOAT);
return false;
}

$this->_setValue($value);
Expand Down

0 comments on commit 4695007

Please sign in to comment.