Zend Framework

Zend_Filter_Input skips validators processing if ALLOW_EMPTY metacommand is set to true

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: Zend_Filter_Input
  • Labels:
    None

Description

See _validateRule() method:

foreach ($data as $fieldKey => $field) {
    if (!is_array($field)) {
        $field = array($field);
    }
    foreach ($field as $value) {
        if (empty($value)) {
            if ($validatorRule[self::ALLOW_EMPTY] == true) {
                continue;
            }
...

Activity

Hide
Alexander Veremyev added a comment -

That's correct since this code iterates through specified field values (this is not multiple-fields rule).
ALLOW_EMPTY overrides other validators results.

Show
Alexander Veremyev added a comment - That's correct since this code iterates through specified field values (this is not multiple-fields rule). ALLOW_EMPTY overrides other validators results.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: