php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70322 ZipArchive::close() doesn't indicate errors
Submitted: 2015-08-21 17:47 UTC Modified: 2015-09-05 00:06 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: [email protected] Assigned: cmb (profile)
Status: Closed Package: Zip Related
PHP Version: 5.6.12 OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: [email protected]
New email:
PHP Version: OS:

 

 [2015-08-21 17:47 UTC] [email protected]
Description:
------------
If closing a ZipArchive fails for whatever reason, no error
indication is given (ZipArchive::close() returns TRUE), and it is
not possible to get further information by calling
ZipArchive::getStatusString(), because the internal zip_t has
already been closed.


Test script:
---------------
<?php
$zip = new ZipArchive();
var_dump($zip->open('./test.zip', ZipArchive::CREATE | ZipArchive::OVERWRITE));
var_dump($zip->close());
?>


Expected result:
----------------
bool(true)
bool(false)


Actual result:
--------------
bool(true)
bool(true)


Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-08-21 17:48 UTC] [email protected]
-Assigned To: +Assigned To: cmb
 [2015-08-21 17:51 UTC] [email protected]
-Summary: ZipArchive::close() always returns TRUE +Summary: ZipArchive::close() doesn't indicate errors
 [2015-08-21 22:00 UTC] [email protected]
-Status: Assigned +Status: Open -Assigned To: cmb +Assigned To:
 [2015-08-21 22:00 UTC] [email protected]
Submitted PR #1481.
 [2015-09-04 22:47 UTC] [email protected]
Automatic comment on behalf of [email protected]
Revision: http://git.php.net/?p=php-src.git;a=commit;h=c77f783777e0169b2a4b7b9439cad76b372290a3
Log: Fix #70322: ZipArchive::close() doesn't indicate errors
 [2015-09-04 22:47 UTC] [email protected]
-Status: Open +Status: Closed
 [2015-09-05 00:06 UTC] [email protected]
-Assigned To: +Assigned To: cmb
 [2015-09-15 12:13 UTC] [email protected]
Automatic comment on behalf of [email protected]
Revision: http://git.php.net/?p=php-src.git;a=commit;h=c77f783777e0169b2a4b7b9439cad76b372290a3
Log: Fix #70322: ZipArchive::close() doesn't indicate errors
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Dec 31 04:00:01 2025 UTC