|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40228 extractTo not extracting empty directories
Submitted: 2007-01-24 23:50 UTC Modified: 2007-01-29 16:02 UTC
From: php-bugs at spuetz dot ath dot cx Assigned: pajoye (profile)
Status: Closed Package: Zip Related
PHP Version: 5.2.0 OS: Linux
Private report: No CVE-ID: None
 [2007-01-24 23:50 UTC] php-bugs at spuetz dot ath dot cx
I have a issue with extractTo(), it's not extracting empty directories.

Reproduce code:
$ mkdir -p test/empty
$ zip -r test
adding: test/ (stored 0%)
adding: test/empty/ (stored 0%)
$ rm -rf test
$ php -r '$zip = new ZipArchive();  $zip->open(""); $zip->extractTo("./");'

Expected result:
unzip works as expected:

$ unzip 
   creating: test/
   creating: test/empty/

Actual result:
$ find


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-01-24 23:53 UTC]
Please try using this CVS snapshot:
For Windows:

 [2007-01-25 00:19 UTC] php-bugs at spuetz dot ath dot cx
It still doesn't work with:

$ php -v
PHP 5.2.1RC4-dev (cli) (built: Jan 25 2007 01:13:23) 
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
 [2007-01-25 00:21 UTC]
Can you provide a link to the "" archive please?

 [2007-01-25 08:44 UTC] php-bugs at spuetz dot ath dot cx

md5 hash is 5f681fa09b179d4763421ea724b3a207
 [2007-01-28 02:54 UTC]
It is fixed in PECL CVS. I will merge into PHP as soon as possible.

You can try the fix using the pecl cvs version. I will merge into PHP as soon as possible.
 [2007-01-29 03:18 UTC]
Fixed in PECL release 1.8.5, waiting the OK from the RM to merge into 5.2.1 (or .2).
 [2007-01-29 16:02 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Jun 03 04:03:39 2023 UTC