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
 [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

Pull Requests

Pull requests:

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: Thu Dec 05 22:01:29 2024 UTC