Skip to content
This repository was archived by the owner on Jan 8, 2020. It is now read-only.

[hotfix/ZF-10461] Zend_Validator_File#365

Closed
thomasweidner wants to merge 2 commits into
zendframework:masterfrom
thomasweidner:hotfix/ZF-10461
Closed

[hotfix/ZF-10461] Zend_Validator_File#365
thomasweidner wants to merge 2 commits into
zendframework:masterfrom
thomasweidner:hotfix/ZF-10461

Conversation

@thomasweidner

Copy link
Copy Markdown
Contributor
  • fixed setting "false" as mimefile
  • fixed Excludemimetype validator to be used in ZF2

- fixed setting "false" as mimefile
- fixed Excludemimetype validator to be used in ZF2
@weierophinney

Copy link
Copy Markdown
Member

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

PHPUnit 3.5.14 by Sebastian Bergmann.

F...

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>.

/home/matthew/git/zf2/tests/Zend/Validator/File/ExcludeMimeTypeTest.php:73

FAILURES!
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

marcing commented Aug 13, 2012

Copy link
Copy Markdown

Please backport it to ZF 1.11.

Actually the solution here does not seem to be right, it should be as Jarek Nowisz suggested:
http://framework.zend.com/issues/browse/ZF-10461?focusedCommentId=51575#comment-51575

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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants