Bug #53893 [Opn->Fbk]: Wrong return value for ZipArchive::extractTo()
| From: | felipe@php.net | Date: | Mon, 31 Jan 2011 20:36:12 +0000 |
| Subject: | Bug #53893 [Opn->Fbk]: Wrong return value for ZipArchive::extractTo() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-158375@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=53893&edit=1
ID: 53893
Updated by: felipe@php.net
Reported by: schmale at froglogic dot com
Summary: Wrong return value for ZipArchive::extractTo()
-Status: Open
+Status: Feedback
Type: Bug
Package: Zip Related
Operating System: Linux
PHP Version: 5.3.5
Block user comment: N
Private report: N
New Comment:
Hello, I've a doubt about the test case. $zipPath points to an empty zip
file?
Previous Comments:
------------------------------------------------------------------------
[2011-01-31 17:49:03] schmale at froglogic dot com
Description:
------------
PHP version (as given in phpinfo()): PHP Version 5.3.3-1ubuntu9.3
Zip-related information:
Zip enabled
Extension Version $Id: php_zip.c 300470 2010-06-15 18:48:33Z pajoye $
Zip version 1.9.1
Libzip version 0.9.0
Test script:
---------------
function testReturnValue() {
$extractToPath = "/home/user/testDir"; /* existing dir with NO
write privileges */
$zipPath = "path/to/zipFile"; // has to be valid zip file
$zip = new ZipArchive();
$open = $zip->open($zipPath);
if ($open === true) {
$extracting = $zip->extractTo($extractToPath);
$zip->close();
return $extracting;
} else {
return false;
}
}
Expected result:
----------------
Return value of testReturnValue() should be FALSE, as long as the php
user has no write access to the directory into which we extract the zip
(because if that's the case, nothing will happen).
Actual result:
--------------
Return value is TRUE, even if no extracting happened due to lacking
privileges.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=53893&edit=1