Details
-
Type:
Improvement
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.8.2
-
Component/s: Zend_Filter_Input
-
Labels:None
Description
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).
Fixed