Issues

ZF-2089: ALLOW_EMPTY ignored when validating multiple fields

Issue Type: Bug Created: 2007-10-19T10:52:03.000+0000 Last Updated: 2007-11-13T10:05:10.000+0000 Status: Resolved Fix version(s): Reporter: Justin Hendrickson (toxygene) Assignee: Darby Felton (darby) Tags: - Zend_Filter_Input

Related issues: - ZF-1859

Attachments: - ZendFilterInput.patch

Description

The value of ALLOW_EMPTY is not checked if there are mutliple fields to be validated.

require_once 'Zend/Filter/Input.php'; require_once 'Zend/Validate/Abstract.php';

class Zend_Validate_AlwaysFails extends Zend_Validate_Abstract { public function isValid($values) { return false; } }

$fails = new Zend_Validate_AlwaysFails();

$input = new Zend_Filter_Input( array(), array( 'test' => array( $fails, 'allowEmpty' => true 'fields' => array('one', 'two') ) ), array( 'one' => '', 'two' => '' ) );

var_dump($input->isValid());

This should return true, but returns false because allow empty is ignored.

Comments

Posted by Justin Hendrickson (toxygene) on 2007-10-19T10:53:03.000+0000

Simple patch I whipped up to fix the problem.

Have you found an issue?

See the Overview section for more details.

Copyright

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

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

Contacts