|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62779 ZipArchive::addFile does not work properly with windows directory separators.
Submitted: 2012-08-08 13:10 UTC Modified: 2013-06-20 10:01 UTC
From: max dot calabrese at nordinteractive dot se Assigned:
Status: Not a bug Package: zip (PECL)
PHP Version: 5.4.5 OS: Windows Server 2008 R2 Web Serve
Private report: No CVE-ID: None
 [2012-08-08 13:10 UTC] max dot calabrese at nordinteractive dot se
ZipArchive::addFile does not work as expected when using windows directory 
separators (/).

Backslashes in string $filename are not converted into folders.

Test script:
$zip = new ZipArchive();

if ($zip->open() === true) {

	// gives a file named "dir/somefile.txt"

	// works properly



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-06-20 10:01 UTC]
-Status: Open +Status: Not a bug
 [2013-06-20 10:01 UTC]
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Jun 13 01:01:23 2021 UTC