wiki.techinc.nl/tests/phpunit/includes/libs/mime
Tim Starling d8e06a46a8 MimeAnalyzer: fix ZIP parsing failure
unpack() actually returns an array with indexes starting from 1, not
zero, so unpack(...)[0] gives a notice and always returns null. It is
lucky that ZIPs normally have zero-length comments, so this would have
had little impact on file type detection aside from log spam.

Also, add a check to make sure the unpack() will not read beyond
the end of the file. Without this, unpack() could generate a warning.

The bug was introduced by me in f12db38048.

Add tests. The test files were generated by appending an EOCDR signature
and some extra bytes to 1bit-png.png.

Bug: T223728
Change-Id: I6fab63102d1d8eea92cdcce5ab6d1eb747a0a890
2019-07-25 13:40:18 +10:00
..
MimeAnalyzerTest.php MimeAnalyzer: fix ZIP parsing failure 2019-07-25 13:40:18 +10:00