ID: 50797 Comment by: legolas558 at users dot sourceforge dot net Reported By: legolas558 at users dot sourceforge dot net Status: Open Bug Type: PHAR related Operating System: Linux 2.6.33-rc4 PHP Version: 5.3.1 New Comment:
My Arch linux system is using zlib 1.2.3.4-3 and no other issues with ZIP files Previous Comments: ------------------------------------------------------------------------ [2010-01-19 07:23:59] legolas558 at users dot sourceforge dot net Description: ------------ PHAR extraction of Zip archives is broken Reproduce code: --------------- <?php // phartest.php try { $phar = new PharData($argv[1]); $phar->extractTo('/tmp', null, true); // extract all files, and overwrite } catch (Exception $e) { echo $e; // handle errors } ?> Expected result: ---------------- When running phartest.php with a zip file, it extracts files with no failure but files contain garbage. File size corresponds but content does not. The script works with TAR or TAR.GZ files seamlessly, so I suspect it's due to some library bug. Files in ZIP archive are compressed with normal Deflate method. Actual result: -------------- Hexdump of "phartest.php" extracted from a "phartest.zip" archive containing only the phartest.php script. 0000000 8e45 0abd 30c2 8514 f367 6714 b428 4a85 0000010 ae71 8bb6 0eee e26e e210 14d5 1362 6f6e 0000020 447f eefa 1146 d33c be19 b3f3 826d 4a0d 0000030 89f8 4297 1254 66ac d0ec 84d1 b463 2d7b 0000040 4b3a df34 f3c7 92e6 7f57 5d66 2cd3 8dac 0000050 7c9c 9696 08f2 8169 706e 80ae 40f0 8579 0000060 c4b2 808f 0e76 d6b7 5f51 7740 f857 7891 0000070 56e2 2d48 5a30 458c 9876 050d 7d69 8487 0000080 78f2 4565 fac6 bfe8 9f83 1b2a 8e83 cc40 0000090 7b9e a8b5 56a6 0dea 4b50 0201 0314 0314 00000a0 0000 0008 4145 3c33 830d bec4 0098 0000 00000b0 00bc 0000 000c 0000 0000 0000 00000bc ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=50797&edit=1