Issue Details (XML | Word | Printable)

Key: ZF-6765
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Alexander Veremyev
Reporter: Alexander Veremyev
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Google issue summary
Zend Framework

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

Created: 21/May/09 04:58 AM   Updated: 22/May/09 06:12 AM   Resolved: 22/May/09 06:12 AM
Return to search "Fixed in 1.5.1"
Component/s: Zend_Filter_Input
Affects Version/s: None
Fix Version/s: 1.8.2

Time Tracking:
Not Specified


 Description  « Hide

Zend_Filter_Input::_validateRule() has the following code:

/**
 * 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).



Alexander Veremyev added a comment - 22/May/09 06:12 AM

Fixed