From:             hscheidegger at zumbach dot ch
Operating system: Windows XP
PHP version:      5.2.0
PHP Bug Type:     Zip Related
Bug description:  Archive corrupt with ZipArchive::addFile method

Description:
------------
We use PHP 5.2 on Windows XP and Server 2003, not the CGI version.
We are running Apache 2 with php as module and php_zip.dll as extension
declared in php.ini.
The following script produces a corrupt zip archive, depending the content
of 'TestDoc1.txt':

<?php
$zip = new ZipArchive;
$res = $zip->open( 'test.zip', ZipArchive::CREATE );
if ($res === TRUE) {
   $zip->addFile( 'TestDoc1.txt', 'entryname1.txt' );
   $zip->close();
   echo 'ok';
} else {
   echo 'failed';
  }
?>

Reproduce code:
---------------
zip archive ok with TestDoc1.txt:
=================================
<body bgcolor="#CED5E5">
<br>

</body>
This is some text, we have to fill the file with nonsense.

zip archive corrupt with TestDoc1.txt:
======================================
<body bgcolor="#CED5E5">
<br>
x
</body>
This is some text, we have to fill the file with nonsense.




-- 
Edit bug report at http://bugs.php.net/?id=39506&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=39506&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=39506&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=39506&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=39506&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=39506&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=39506&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=39506&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=39506&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=39506&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=39506&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=39506&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=39506&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=39506&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=39506&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=39506&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=39506&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=39506&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=39506&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=39506&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=39506&r=mysqlcfg

Reply via email to