php.net |  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
Votes:1
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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: michel dot hartmann at mayflower dot de
New email:
PHP Version: OS:

 

 [2010-11-23 14:31 UTC] michel dot hartmann at mayflower dot de
Description:
------------
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:
---------------
<?php
$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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-08-29 20:00 UTC] bjori@php.net
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] bjori@php.net
-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-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 13:01:30 2024 UTC