From: Operating system: Linux 2.6.27 PHP version: 5.2.13 Package: Zip Related Bug Type: Bug Bug description:deleteName() for directories returns True on non-success
Description: ------------ When trying to delete a non-empty directory in a ZIP file with deleteName() the function will return True and not delete the directory if it is not empty. Expectation would be to return False if the directory can not be deleted. Also the directory handling should be better documentated (usage of trailing slashes, examples). Test script: --------------- $zip = new ZipArchive; if( $zip->open('archive.zip', ZipArchive::CREATE) ) { $zip->addEmptyDir('folder'); $zip->addFile('folder/file.txt'); if( ! $zip->deleteName('folder/') ) { echo 'Should end up here if folder not deletable'; } } $zip->close(); Expected result: ---------------- Should echo. Actual result: -------------- Will not echo. -- Edit bug report at http://bugs.php.net/bug.php?id=51857&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=51857&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=51857&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=51857&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=51857&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51857&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=51857&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=51857&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=51857&r=needscript Try newer version: http://bugs.php.net/fix.php?id=51857&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=51857&r=support Expected behavior: http://bugs.php.net/fix.php?id=51857&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=51857&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=51857&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=51857&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51857&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=51857&r=dst IIS Stability: http://bugs.php.net/fix.php?id=51857&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=51857&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=51857&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=51857&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=51857&r=mysqlcfg