php.net |  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: 2020-03-18 12:38 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: jave dot web at seznam dot cz Assigned:
Status: Not a bug Package: Zip Related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2019-01-22 16:14 UTC] jave dot web at seznam dot cz
Description:
------------
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:
$zip->getFromName('subFolderTest/test.txt');

---
From manual page: https://php.net/ziparchive.getfromname
---


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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-03-18 12:38 UTC] remi@php.net
-Status: Open +Status: Not a bug
 [2020-03-18 12:38 UTC] remi@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

Please propose a documentation change.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Aug 07 21:01:25 2020 UTC