Edit report at https://bugs.php.net/bug.php?id=67161&edit=1
ID: 67161
Comment by: aimanshabouri1 at gmail dot com
Reported by: bugs dot php dot net at tjbp dot net
Summary: ZipArchive::getStream() returns NULL for certain
file
Status: Closed
Type: Bug
Package: Zip Related
Operating System: Arch Linux x64
PHP Version: 5.5.11
Assigned To: jpauli
Block user comment: N
Private report: N
New Comment:
<a href="https://www.karizmac.com/drug-treatment-centers-as-paths-to-correction/">Drug
Treatment Centers</a> The medication treatment program is a generally new field. It just began
at some point inside the most recent 50 years.
Previous Comments:
------------------------------------------------------------------------
[2015-05-12 12:37:09] jpauli@php.net
Please try using this snapshot:
http://snaps.php.net/php-trunk-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
Merged against master
------------------------------------------------------------------------
[2014-05-12 16:09:12] cmbecker69 at gmx dot de
I assume the file can't be read, because it is compressed with
Deflate64 (byte 0x140 of zipbug.zip is 0x09), and this compression
method is likely to be unsupported.
The NULL return value is the result of zip_stat() succeeding, but
php_stream_zip_open() failing in ZipArchive::getStream()[1]. A
simple
else {
RETURN_FALSE;
}
at the end of the method would return FALSE, but the return value
of NULL may well be by design, and if so the documentation should
be improved.
[1] <http://lxr.php.net/xref/PHP_5_5/ext/zip/php_zip.c#2582>
------------------------------------------------------------------------
[2014-04-30 19:30:06] bugs dot php dot net at tjbp dot net
Description:
------------
According to the documentation, ZipArchive::getStream() will return the contents of a file, or false
on failure. I'm receiving NULL for a certain file in an archive, though the archive passes
validation with unzip -t.
The archive in question:
http://upload.tjbp.net/zipbug.zip
Test script:
---------------
$za = new \ZipArchive;
$za->open('zipbug.zip');
var_dump($za->getStream('gta_sa.set'));
Expected result:
----------------
Contents of the file in the archive
Actual result:
--------------
NULL
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=67161&edit=1