Issues

ZF-3118: Validation problem with array elements

Description

There seems to be a mistake on the isValid method of the Zend_Form_Element class. The validation is performed twice for array's elements. Each items of the array are validated, then the array is validated too.

Suggested fix : Prepend the "else" keyword on the line 1203 on revision 9215 :



Then the problem will be solved with the classical test :

public function isValid($value, $context = null) { ... foreach ($this->getValidators() as $key => $validator) { ... if ($isArray && is_array($value)) ... else if ($validator->isValid($value, $context)) ... else ... ... } ... } ```

Greetings.

Comments

Please evaluate and categorize as necessary.

Scheduling for next mini release.

Resolved in both trunk and 1.5 release branch as of r9315.