Bug #53385 [Opn->Fbk]: Phar stream wrapper can't handle escaped paths
| From: | bjori@php.net | Date: | Mon, 29 Aug 2011 20:00:31 +0000 |
| Subject: | Bug #53385 [Opn->Fbk]: Phar stream wrapper can't handle escaped paths | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-163113@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=53385&edit=1
ID: 53385
Updated by: bjori@php.net
Reported by: michel dot hartmann at mayflower dot de
Summary: Phar stream wrapper can't handle escaped paths
-Status: Open
+Status: Feedback
Type: Bug
Package: PHAR related
Operating System: debian
PHP Version: 5.3.3
Block user comment: N
Private report: N
New Comment:
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..
Previous Comments:
------------------------------------------------------------------------
[2010-11-23 14:31:20] 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
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=53385&edit=1