zendframework / zend-validator

Validator component from Zend Framework
BSD 3-Clause "New" or "Revised" License
181 stars 136 forks source link

Mimetype-Validation of Multiple Files broken #176

Closed BlckStar closed 7 years ago

BlckStar commented 7 years ago

https://github.com/zendframework/zend-validator/commit/3fc1e6614672eb7dbba816677c5a660a953bb563

This currently Breaks Mimetype-Validation of Multiple Files because it closes the finfo-handle after the first validation. At the second Validation the finfo-handle is closed and does not reopen at the setMagicFile-Function.

werc commented 7 years ago

Agree with @BlckStar. When "multiple" input has one file validation is ok. But when sending more than one files there is a warning message:

WARN (4): finfo_file(): supplied resource is not a valid file_info resource {"errno":2,"file":"....\\vendor\\zendframework\\zend-validator\\src\\File\\MimeType.php","line":387}

Before 2.9.1 worked fine.