zendframework / zend-inputfilter

InputFilter component from Zend Framework
BSD 3-Clause "New" or "Revised" License
64 stars 50 forks source link

Argument 2 passed to Zend\InputFilter\BaseInputFilter::validateInputs() must be of the type array, object given #15

Closed orporan closed 9 years ago

orporan commented 9 years ago

This issue was introduced between version 2.5.1 and 2.5.3, i've switched back and forth between the two versions and I keep getting this error with 2.5.3 but not with 2.5.1 this happens when i try to validate a simple post data

Catchable fatal error: Argument 2 passed to Zend\InputFilter\BaseInputFilter::validateInputs() must be of the type array, object given, called in C:\crazylister\vendor\zendframework\zend-inputfilter\src\BaseInputFilter.php on line 221 and defined in C:\crazylister\vendor\zendframework\zend-inputfilter\src\BaseInputFilter.php on line 232

weierophinney commented 9 years ago

It was introduced with 2.5.2, via 3575ece fixing #7.

$this->data is guaranteed to be iterable, but may, as you note, not be an actual array. As such, there are two paths forward:

I think the first would be simpler, and will get a patch out today, likely with an updated 2.5 tag immediately, and an LTS release early next week.

weierophinney commented 9 years ago

I've labelled as "BC Break" to indicate that the bug is drawing attention to an existing BC Break. The patch that I've now attached to this issue fixes it.

weierophinney commented 9 years ago

Will release with versions 2.4.7 (LTS compatibility) and 2.5.4 (5.5+ compat).