|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #77500 ZipArchive::getFromName works with path, not just name
Submitted: 2019-01-22 16:14 UTC Modified: -
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: jave dot web at seznam dot cz Assigned:
Status: Open Package: Zip Related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: jave dot web at seznam dot cz
New email:
PHP Version: OS:


 [2019-01-22 16:14 UTC] jave dot web at seznam dot cz
Documentation for ZipArchive::getFromName is misleading.
The first parameter is actually a relative (to root of the archive) path, docs say "Name" which can falsely imply file would be found just by its filename, which doesn't happen when it is inside a directory.

To get to a deeper file, you must specify the path like:

From manual page:

Test script:
//considering archive structure
//subFolderTest (d)
// - test.txt (f)
// - test2.txt (f)

$zip->getFromName('test.txt'); //this will not find anything
$zip->getFromName('subFolderTest/test.txt'); //this will find the file


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Feb 25 09:01:24 2020 UTC