#48763 [Csd]: ZipArchive produces corrupt OpenOffice.org files
| From: | pajoye@php.net | Date: | Thu, 05 Nov 2009 12:13:24 +0000 |
| Subject: | #48763 [Csd]: ZipArchive produces corrupt OpenOffice.org files | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-144290@lists.php.net to get a copy of this message | ||
ID: 48763
Updated by: pajoye@php.net
Reported By: dani dot church at gmail dot com
Status: Closed
Bug Type: Zip Related
Operating System: CentOS 5
PHP Version: 5.2CVS-2009-07-01 (snap)
Assigned To: pajoye
New Comment:
Fixed in latest releases too.
Previous Comments:
------------------------------------------------------------------------
[2009-11-05 12:12:26] pajoye@php.net
This bug has been fixed in SVN.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
------------------------------------------------------------------------
[2009-11-05 11:31:50] levelak at post dot cz
This bug does not only affect OpenOffice, but also WinRar (I have
version 3.80 under Windows).
The bug happens whenever a file with more than 255 chars is added via
addFromString...
eg.:
$zip->addFromString("test.txt","asdjdjfdlksjdaf"); //OK
$zip->addFromString("test2.txt",str_repeat("A",256); //Corrupt archive
The issue is resolved by upgrading to 5.2.11, on 5.2.6 it also works
with no problems.
------------------------------------------------------------------------
[2009-07-19 16:37:42] pajoye@php.net
Thanks for your patch! I have applied it to all branches and pecl. A
pecl release will be done next week.
Please note that the patch has been applied upstream as well (libzip
repo).
I will close the bug once the test is there too.
------------------------------------------------------------------------
[2009-07-04 14:37:24] dani dot church at gmail dot com
RalfBecker: In fact, one probable workaround, until this bug gets
fixed, is to iterate through EVERY file in the ZipArchive, get the
contents, and addFromString to put them back into the archive. By
overwriting every single file in the archive (with its own contents),
you won't trigger the bug.
------------------------------------------------------------------------
[2009-07-04 08:29:41] RalfBecker at outdoor-training dot de
I can reproduce that bug with php5.2.9 under openSUSE11.0, thought I
tried so far only oo3 *.odt files. It seems not to depend on the file,
in fact I can not create a file, where I can replace content.xml with
itself, without corrupting it.
Ralf
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/48763
--
Edit this bug report at http://bugs.php.net/?id=48763&edit=1