Issue Type: Bug Created: 2009-08-18T23:23:10.000+0000 Last Updated: 2010-06-09T05:54:04.000+0000 Status: Resolved Fix version(s): - 1.9.2 (25/Aug/09)
Reporter: Edi Skraba (edspiner) Assignee: Thomas Weidner (thomas) Tags: - Zend_Validate
Related issues: - ZF-7449
Zend_Validate_NotEmpty doesn't accept anything else then string, int, float, bool but it was. Now object, arrays, etc are returnd as "empty"
Posted by Thomas Weidner (thomas) on 2009-08-18T23:55:20.000+0000
No they're not. You should look which sort of failure is returned.
In the above case you get "Invalid type given, value should be float, string, or integer".
I agree that Arrays are missing. But a object can never be empty. To check a object for emptyness is quite useless and in my eyes a failure. Same for ressources.
Posted by Edi Skraba (edspiner) on 2009-08-19T01:53:16.000+0000
What if i have such code:
$value = ($_POST['value']) ? new Zend_Date($_POST['value']) : null;
And im checking: Zend_Validate::is($value,'NotEmpty')
I know that i can make a different solution but - as above - i don't know what's the type of $value - i just wan't to check if it's "NotEmpty".
As You said the objects are never empty so it could bo something like: if(is_object($value)) return true;
Posted by Thomas Weidner (thomas) on 2009-08-19T13:08:38.000+0000
Allowed arrays. Objects and Ressources are disallowed.
Posted by Thomas Baumann (t11n) on 2010-06-09T05:53:59.000+0000
Please see ZF-9968
Have you found an issue?
See the Overview section for more details.