From:             legolas558 at users dot sourceforge dot net
Operating system: Linux 2.6.33-rc4
PHP version:      5.3.1
PHP Bug Type:     PHAR related
Bug description:  PHAR fails to extract ZIP archives, but TAR is ok

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 bug report at http://bugs.php.net/?id=50797&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=50797&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=50797&r=trysnapshot53
Try a snapshot (PHP 6.0):            
http://bugs.php.net/fix.php?id=50797&r=trysnapshot60
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=50797&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=50797&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=50797&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=50797&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=50797&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=50797&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=50797&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=50797&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=50797&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=50797&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=50797&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=50797&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=50797&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=50797&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=50797&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=50797&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=50797&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=50797&r=mysqlcfg

Reply via email to