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
Posted by Wil Sinclair (wil) on 2008-04-18T13:16:14.000+0000
Please evaluate and categorize as necessary.
Posted by Matthew Weier O'Phinney (matthew) on 2008-04-22T10:44:59.000+0000
Scheduling for next mini release.
Posted by Matthew Weier O'Phinney (matthew) on 2008-04-25T11:28:40.000+0000
Resolved in both trunk and 1.5 release branch as of r9315.