Zend Framework

Zend_Filter_Input skips ALLOW_EMPTY metacommand processing if rule refers several fields.

Details

  • Type: Docs:  Improvement Docs: Improvement
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.8.2
  • Component/s: Zend_Filter_Input
  • Labels:
    None
  • Language:
    English

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.

Issue Links

Activity

Hide
Alexander Veremyev added a comment -

Fixed.

Show
Alexander Veremyev added a comment - Fixed.
Hide
Alexander Veremyev added a comment -

Issue is reopened.

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

Show
Alexander Veremyev added a comment - Issue is reopened. It's correct to process several fields as a special case. But it still needs ALLOW_EMPTY metacommand processing.
Hide
Alexander Veremyev added a comment -

Fixed.

Show
Alexander Veremyev added a comment - Fixed.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: