Bug #70322 [Asn->Opn]: ZipArchive::close() doesn't indicate errors

From: Date: Fri, 21 Aug 2015 22:00:39 +0000
Subject: Bug #70322 [Asn->Opn]: ZipArchive::close() doesn't indicate errors
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-195417@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70322&edit=1 ID: 70322 Updated by: cmb@php.net Reported by: cmb@php.net Summary: ZipArchive::close() doesn't indicate errors -Status: Assigned +Status: Open Type: Bug Package: Zip Related Operating System: * PHP Version: 5.6.12 -Assigned To: cmb +Assigned To: Block user comment: N Private report: N New Comment: Submitted PR #1481. Previous Comments: ------------------------------------------------------------------------ [2015-08-21 17:47:44] 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) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=70322&edit=1

« previous php.bugs (#195417) next »