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: cmb@php.net Assigned: cmb (profile)
Status: Closed Package: Zip Related
PHP Version: 5.6.12 OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
43 + 14 = ?
Subscribe to this entry?

 
 [2015-08-21 17:47 UTC] cmb@php.net
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

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-08-21 17:48 UTC] cmb@php.net
-Assigned To: +Assigned To: cmb
 [2015-08-21 17:51 UTC] cmb@php.net
-Summary: ZipArchive::close() always returns TRUE +Summary: ZipArchive::close() doesn't indicate errors
 [2015-08-21 22:00 UTC] cmb@php.net
-Status: Assigned +Status: Open -Assigned To: cmb +Assigned To:
 [2015-08-21 22:00 UTC] cmb@php.net
Submitted PR #1481.
 [2015-09-04 22:47 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
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] cmb@php.net
-Status: Open +Status: Closed
 [2015-09-05 00:06 UTC] cmb@php.net
-Assigned To: +Assigned To: cmb
 [2015-09-15 12:13 UTC] ab@php.net
Automatic comment on behalf of cmbecker69@gmx.de
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-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 10:01:28 2024 UTC