|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69153 filenames with ? not consistently supported
Submitted: 2015-03-01 20:05 UTC Modified: 2021-01-21 11:48 UTC
From: greg at freephile dot com Assigned:
Status: Verified Package: PHAR related
PHP Version: 5.5.22 OS: Ubuntu 14.04.2 LTS
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2015-03-01 20:05 UTC] greg at freephile dot com
PharData() unable to read filename which DirectoryIterator CAN read, and zip_open() CAN read.

Test script:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-03-01 20:20 UTC] greg at freephile dot com
Perhaps this is a "documentation issue" since I was able to get the PharData() invocation to work when I passed the flag 'CURRENT_AS_SELF'


I don't really know whether this is intended behavior or if there is a bug.
 [2021-01-21 11:48 UTC]
-Summary: filename causes exception +Summary: filenames with ? not consistently supported -Status: Open +Status: Verified
 [2021-01-21 11:48 UTC]
The problem is the question mark in the filename
tablepress-combined.min.css?ver=6.css.  This is regarded as the
beginning of a query string[1], so Phar looks for the filename
tablepress-combined.min.css which doesn't exist, because the full
filename has been stored in the Phar's manifest.

Working around by setting CURRENT_AS_SELF helps in this case,
because then phar_path_check() isn't involved.  However, other
means to access the file (e.g. ::__offsetGet()) have the same

Not sure if this is to be seen as bug or merely a documentation
issue, but it certainly not intended behavior.

And then there is the not directly related issue that question
marks are not valid in filenames on Windows, so extraction would
fail there (same with ext/zip).

[1] <>
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon Mar 27 15:04:44 2023 UTC