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