php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58595 php-zip can not produce a zip/openoffice.org readable archive
Submitted: 2009-03-23 17:01 UTC Modified: 2009-07-20 15:23 UTC
From: wendy dot umarov at free dot fr Assigned:
Status: Closed Package: zip (PECL)
PHP Version: 5_2 CVS-2009-03-23 (dev) OS: Linux Mandriva 2009.0 and 2009.1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: wendy dot umarov at free dot fr
New email:
PHP Version: OS:

 

 [2009-03-23 17:01 UTC] wendy dot umarov at free dot fr
Description:
------------
The actual 1.8.10 php-zip extension create an unreadable zip file for openoffice.org application.


Reproduce code:
---------------
ZipArchive::open("openoffice_file.odt");
ZipArchive::addFromString('content.xml',$valid_xml_content);
ZipArchive::close();

-> produce an unreadable document.

Sample at http://pastebin.mandriva.com/7659


Expected result:
----------------
A valid oasis document. 

Actual result:
--------------
unreadable oasis document via OpenOffice 3.0.0


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-05-20 16:33 UTC] xsa at amstergroup dot com
I encounter same problem under Windows XP 32-Bit, with wampserver PHP-5.2.9-2, using following code (and previous exemple code do the same):

$zip = new ZipArchive();
$zip->open($outputfile, ZipArchive::CHECKCONS);
$zip->deleteName('content.xml');
$zip->addFile($this->filename, 'content.xml');
$zip->close();

If I copy original ODT file, store new content.xml file using 7Z by exemple to this copy, archive is not corrupted.

If I compare the properties of the content.xml in corrupted archive and in manual updated copy, compressed size of the corrupted file is less than the one obtained using manual method.  File checksum seems to be same ?
 [2009-05-20 17:28 UTC] xsa at amstergroup dot com
After some checks, this works fine in PHP 5.2.5, corrupt archive in PHP 5.2.8, and corrupt added file in PHP 5.2.9-2.

Concerning size difference in 7Z, they already exists in PHP 5.2.5 and CRC is same.

I will try to move dll file from 5.2.5 to 5.2.9-2, to see if mod_zip is the problem.
 [2009-05-21 05:59 UTC] xsa at amstergroup dot com
After test, it seems that using the php_zip.dll provided with php 5.2.5 in php 5.2.9-2 doesn't corrupt archive or files in archives.
 [2009-07-01 20:14 UTC] dani dot church at gmail dot com
This problem still exists in PHP 5.2CVS-2009-07-01.  I have opened a bug on the PHP bug tracker at:

http://bugs.php.net/bug.php?id=48763

Also, the zip extension from PHP 5.2.6 is not affected, so as a workaround, you can use that version of the extension.
 [2009-07-10 09:10 UTC] jesbuddy07 at hotmail dot com
how can i download the PHP_ZIP.dll from 5.2.6?
 i went to PECL site, they have version 1.8.10 and earlier, 
but when i download the package, there is no dll inside.
 [2009-07-20 15:23 UTC] pierre dot php at gmail dot com
Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download at
http://pecl.php.net/get/zip


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 00:01:29 2024 UTC