Issues

ZF-3118: Validation problem with array elements

Issue Type: Patch Created: 2008-04-16T04:46:33.000+0000 Last Updated: 2008-05-05T11:44:48.000+0000 Status: Resolved Fix version(s): - 1.5.2 (15/May/08)

Reporter: Adrien13 (adrien13) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Form

Related issues: Attachments:

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 :

<pre class="highlight">

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.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts