Issues

ZF-6711: Zend_Filter_Input skips ALLOW_EMPTY metacommand processing if rule refers several fields.

Description

It uses:


if (count((array) $validatorRule[self::FIELDS]) > 1) {
    if (!$validatorRule[self::VALIDATOR_CHAIN]->isValid($data)) {
        $this->_invalidMessages[$validatorRule[self::RULE]] = $validatorRule[self::VALIDATOR_CHAIN]->getMessages();
        $this->_invalidErrors[$validatorRule[self::RULE]] = $validatorRule[self::VALIDATOR_CHAIN]->getErrors();
        return;
    }
} else {
...

construction.


if (count((array) $validatorRule[self::FIELDS]) == 1) {
...

actually should be used here.

But this code also skips ALLOW_EMPTY metacommand processing for this special case. So it should be removed at all.

Comments

Fixed.

Issue is reopened.

It's correct to process several fields as a special case. But it still needs ALLOW_EMPTY metacommand processing.

Fixed.