Bug #69153 [Opn->Ver]: filenames with ? not consistently supported

From: Date: Thu, 21 Jan 2021 11:48:27 +0000
Subject: Bug #69153 [Opn->Ver]: filenames with ? not consistently supported
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-231676@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69153&edit=1

 ID:                 69153
 Updated by:         cmb@php.net
 Reported by:        greg at freephile dot com
-Summary:            filename causes exception
+Summary:            filenames with ? not consistently supported
-Status:             Open
+Status:             Verified
 Type:               Bug
 Package:            PHAR related
 Operating System:   Ubuntu 14.04.2 LTS
 PHP Version:        5.5.22
 Block user comment: N
 Private report:     N

 New Comment:

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
issue.

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] <https://github.com/php/php-src/blob/php-7.4.14/ext/phar/phar_path_check.re#L80-L87>


Previous Comments:
------------------------------------------------------------------------
[2015-03-01 20:20:03] 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'

$reader->setFlags(FilesystemIterator::CURRENT_AS_SELF);

I don't really know whether this is intended behavior or if there is a bug.

------------------------------------------------------------------------
[2015-03-01 20:05:12] greg at freephile dot com

Description:
------------
PharData() unable to read filename which DirectoryIterator CAN read, and zip_open() CAN read.

Test script:
---------------
http://pastebin.com/WbEgf0Nz



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=69153&edit=1


Thread (3 messages)

« previous php.bugs (#231676) next »