|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-09-12 08:59 UTC] ab@php.net
-Status: Open
+Status: Not a bug
[2014-09-12 08:59 UTC] ab@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 08:00:01 2025 UTC |
Description: ------------ You may use ZipArchive->addEmptyDir to add a folder in a parent directory without renaming it. You can then extract using ZipArchive and the folder will be recreated in the parent folders of the destination. Test script: --------------- <?php $archive = new ZipArchive(); $archive->open('a.zip',ZipArchive::CREATE); $archive->addEmptyDir("../../down"); $archive->close(); $archive2 = new ZipArchive(); $archive2->open('a.zip'); $archive2->extractTo('.'); $archive2->close(); Expected result: ---------------- During creation: An error. The ZIP file should not be created. During extraction: It should silently succeed. The folder "down" should not be created. Actual result: -------------- The file "a.zip" was created. During extraction, the folder "down" was created in the grandfather directory.