ZF-6765: Zend_Filter_Input::_validateRule() iterates through provided fields when it's not necessary

Issue Type: Improvement Created: 2009-05-21T04:58:19.000+0000 Last Updated: 2009-05-22T06:12:45.000+0000 Status: Resolved Fix version(s): - 1.8.2 (27/May/09)

Reporter: Alexander Veremyev (alexander) Assignee: Alexander Veremyev (alexander) Tags: - Zend_Filter_Input

Related issues: Attachments:


Zend_Filter_Input::_validateRule() has the following code:

<pre class="highlight">
 * Evaluate the inputs against the validator chain.
if (count((array) $validatorRule[self::FIELDS]) > 1) {
} else {
    $failed = false;
    foreach ($data as $fieldKey => $field) {

But $data cardinality is always less than (array) $validatorRule[self::FIELDS] cardinality since $data elements are collected by iterating through it.

It's not a bug, but it reduces code readability ($data is always one element array).


Posted by Alexander Veremyev (alexander) on 2009-05-22T06:12:45.000+0000


Have you found an issue?

See the Overview section for more details.


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

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