From:             
Operating system: Linux
PHP version:      5.3.5
Package:          Zip Related
Bug Type:         Bug
Bug description:Wrong return value for ZipArchive::extractTo()

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 bug report at http://bugs.php.net/bug.php?id=53893&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=53893&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=53893&r=trysnapshot53
Try a snapshot (trunk):              
http://bugs.php.net/fix.php?id=53893&r=trysnapshottrunk
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=53893&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=53893&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=53893&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=53893&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=53893&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=53893&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=53893&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=53893&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=53893&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=53893&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=53893&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=53893&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=53893&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=53893&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=53893&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=53893&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=53893&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=53893&r=mysqlcfg

Reply via email to