#48763 [Csd->Asn]: ZipArchive produces corrupt OpenOffice.org files

From: Date: Mon, 01 Feb 2010 20:19:27 +0000
Subject: #48763 [Csd->Asn]: ZipArchive produces corrupt OpenOffice.org files
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-147120@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 +Status: Assigned Bug Type: Zip Related Operating System: CentOS 5 PHP Version: 5.2CVS-2009-07-01 (snap) Assigned To: pajoye New Comment: reopen and assign to me. Previous Comments: ------------------------------------------------------------------------ [2009-11-05 12:13:24] pajoye@php.net Fixed in latest releases too. ------------------------------------------------------------------------ [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. ------------------------------------------------------------------------ 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

« previous php.bugs (#147120) next »