Permalink
Browse files

Merge pull request #2345 from mikestowe/ZF2-550

[ZF2-550]   Removed type check so that string("5.00") is recognized as equal to int(5) to validate it is a float
  • Loading branch information...
2 parents e5167b7 + 4936bc2 commit e1c20442194842cdf45a4aea085ba53e8d1cbe5d @DASPRiD DASPRiD committed Sep 13, 2012
Showing with 2 additions and 1 deletion.
  1. +1 −1 library/Zend/I18n/Validator/Float.php
  2. +1 −0 tests/ZendTest/I18n/Validator/FloatTest.php
View
2 library/Zend/I18n/Validator/Float.php
@@ -123,7 +123,7 @@ public function isValid($value)
$valueFiltered = str_replace($groupingSep, '', $value);
$valueFiltered = str_replace($decimalSep, '.', $valueFiltered);
- if (strval($parsedFloat) !== $valueFiltered) {
+ if (strval($parsedFloat) != $valueFiltered) {
$this->error(self::NOT_FLOAT);
return false;
}
View
1 tests/ZendTest/I18n/Validator/FloatTest.php
@@ -59,6 +59,7 @@ public function basicProvider()
array(0.01, true),
array(-0.1, true),
array('10.1', true),
+ array('5.00', true),
array(1, true),
array('10.1not a float', false),
);

0 comments on commit e1c2044

Please sign in to comment.