ZF-4379: Fail to validate empty array

Issue Type: Bug Created: 2008-09-25T08:28:42.000+0000 Last Updated: 2012-03-05T23:13:17.000+0000 Status: Resolved Fix version(s): - 1.7.0 (17/Nov/08)

Reporter: Benoit Aubuchon (beau) Assignee: Felix De Vliegher (felixdv) Tags: - Zend_Filter_Input

Related issues: - ZF-11710



It's possible to make an empty array pass as a valid Int or any other type of validation because the validation step is completly skip in Zend_Filter_Input.

array( 'presence' => 'required', 'Int' ) ); $data = array( 'age' => array() ); $input = new Zend\_Filter\_Input(null, $validator, $data, array(Zend\_Filter\_Input::ALLOW\_EMPTY => false)); if ( $input->isValid() ) { echo 'Age '; var\_dump($data['age']); echo ' is valid!'; } else { echo 'Age is not valid'; } ### Comments Posted by Felix De Vliegher (felixdv) on 2008-11-08T06:49:05.000+0000 Fixed in revision #12430. Fix empty array validation with Zend\_Filter\_Input. Posted by Wil Sinclair (wil) on 2008-11-13T14:09:58.000+0000 Changing issues in preparation for the 1.7.0 release.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.