ZF-221: Zend_Filter::isDigits() operates erratically
Description
Zend_Filter::isDigits() sometimes returns false on values that are digits. The solution is simple:
public static function isDigits($value)
{
--- return ctype_digit($value);
+++ return ctype_digit((string) $value);
}
I marked this major because I use this for all ID validation in my applications.
Comments
Posted by Mark Evans (sparky) on 2006-07-12T05:00:04.000+0000
Can you give some examples where it fails?
Posted by Matthew Ratzloff (mratzloff) on 2006-07-12T10:17:12.000+0000
{quote} Fatal error: Uncaught exception 'Exception' with message 'Expected second ID' in /path/to/ExampleController.php:312 Stack trace:
0 /path/to/ExampleController.php(184): ExampleController->doSomething('7', 19)[...]
{quote}
Changing Zend_Filter::isDigits() as indicated results in correct execution. See http://us2.php.net/manual/en/….
You might also change to
```
which is what I went ahead and did.
Posted by Matthew Ratzloff (mratzloff) on 2006-07-12T10:22:17.000+0000
I meant to say see the last two comments of http://us2.php.net/manual/en/…
So much for dynamic typing. :-) A bug in PHP?