Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

[hotfix/ZF-10461] Zend_Validator_File #365

wants to merge 2 commits into


None yet
3 participants

thomasweidner commented Aug 29, 2011

  • fixed setting "false" as mimefile
  • fixed Excludemimetype validator to be used in ZF2

thomasweidner added some commits Aug 19, 2011

@thomasweidner thomasweidner Merge branch 'master' of git://github.com/zendframework/zf2 d7438ec
@thomasweidner thomasweidner [hotfix/ZF-10461] Zend_Validator_File
- fixed setting "false" as mimefile
- fixed Excludemimetype validator to be used in ZF2

weierophinney commented Aug 30, 2011

tests/Zend/Validator/File/ExcludeMimeTypeTest.php fails on the first data set of testBasic():

PHPUnit 3.5.14 by Sebastian Bergmann.


Time: 0 seconds, Memory: 9.00Mb

There was 1 failure:

1) ZendTest\Validator\File\ExcludeMimeTypeTest::testBasic
Tested with array (
  0 => 'image/gif',
  1 => false,
Failed asserting that <boolean:true> matches expected <boolean:false>.


Tests: 4, Assertions: 18, Failures: 1.

This is true for all but the very last data set (array(array('image/jpeg', 'jpeg'), true)).

In debugging this, it appears that finfo is giving back a MIME type of "application/octet-stream" for the file we're testing against (testsize.mo). This is occurring on an Ubuntu 11.04 install running PHP 5.3.5. I've decided to merge anyways, but we may need to do some work on the testbed to ensure these tests will pass for all platforms.

marcing commented Aug 13, 2012

Please backport it to ZF 1.11.

Actually the solution here does not seem to be right, it should be as Jarek Nowisz suggested:

The fix should not require setting the file to "false".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment