|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53385 Phar stream wrapper can't handle escaped paths
Submitted: 2010-11-23 14:31 UTC Modified: 2013-02-18 00:34 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: michel dot hartmann at mayflower dot de Assigned:
Status: No Feedback Package: PHAR related
PHP Version: 5.3.3 OS: debian
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2010-11-23 14:31 UTC] michel dot hartmann at mayflower dot de
If you have a .phar in a directory that contains spaces (e.g. "/some/path with spaces/example.phar") it is not possible to read files in that phar using their full and escaped path (e.g. "phar:///some/path%20with%20spaces/example.phar/README").

This got to my attention since simplexml_load_file always escapes the provided paths.

Test script:
$readme = file_get_contents('phar:///some/path%20with%20spaces/example.phar/README');

Expected result:
$readme contains data from "phar:///some/path with spaces/example.phar/README"

Actual result:
PHP Warning:  file_get_contents(phar:///some/path%20with%20spaces/example.phar/README): failed to open stream: phar error: invalid url or non-existent phar "phar:///some/path%20with%20spaces/example.phar/README" in *** on line 2


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-08-29 20:00 UTC]
Why do you expect be able to access files within a .phar using urlencoded spaces?

I can't do that on my normal filesystem either..
 [2011-08-29 20:00 UTC]
-Status: Open +Status: Feedback
 [2013-02-18 00:34 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Dec 06 15:03:34 2021 UTC