Issues

ZF-2089: ALLOW_EMPTY ignored when validating multiple fields

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

Simple patch I whipped up to fix the problem.