php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71904 Not extracting folder, only contents
Submitted: 2016-03-26 11:30 UTC Modified: 2016-04-10 04:22 UTC
From: skrzypecki at gmail dot com Assigned: cmb (profile)
Status: No Feedback Package: Zip Related
PHP Version: 7.0.4 OS: Centos
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
39 - 15 = ?
Subscribe to this entry?

 
 [2016-03-26 11:30 UTC] skrzypecki at gmail dot com
Description:
------------
https://www.reddit.com/r/PHPhelp/comments/4b2go8/zipfile_from_c_behaves_different_in_php55_and/

When creating a zip folder with c#'s ZipFile.CreateFromDirectory(path, zipPath, CompressionLevel.Optimal, true); we get a zip which contains a folder.

If this zip is extracted with php55 ($zip->extractTo('/my/destination/dir/');), we have the extracted folder in the location we defined.

But when the zip is extracted with php70 with exactly the same call as above we dont get the folder in the defined extractTo path, but the contents in the folder.

So in php77 the folder which is in the zip is skipped and the contents in the folder is extracted.

The strange thing is that this only happens when using the c# call. So i'm not sure if it's a php thing or c# thing. When i create a zip with a folder in the trough 7zip, php70 behaves exactly as expected (which is what php55 does).


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-03-31 13:04 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2016-03-31 13:04 UTC] cmb@php.net
Please supply (for downloading from somewhere on the web) a
minimal ZIP archive which exhibits the reported behavior .
 [2016-04-10 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Feb 24 23:01:25 2020 UTC