php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28931 parse_url() can't handle scheme:///path
Submitted: 2004-06-26 06:40 UTC Modified: 2004-06-28 21:39 UTC
From: cleong at nflc dot org Assigned:
Status: Not a bug Package: *Directory/Filesystem functions
PHP Version: 4.3.6 OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: cleong at nflc dot org
New email:
PHP Version: OS:

 

 [2004-06-26 06:40 UTC] cleong at nflc dot org
Description:
------------
The function handles urls of the form 'file:///C:\filename.ext' correctly, but when the scheme is not 'file' (e.g. 'cow:///C:\chicken.pie), it throws an error.

Would be nice if it behave the same way as parse_url() is useful for parsing the path to custom stream in ::stream_open().

Reproduce code:
---------------
print_r(parse_url('file:///C:\index.php'));

print_r(parse_url('cow:///C:\index.php'));

Expected result:
----------------
Array ( [scheme] => file [path] => /C:\index.php ) 
Array ( [scheme] => cow [path] => /C:\index.php ) 

Actual result:
--------------
Array ( [scheme] => file [path] => /C:\index.php ) 
Warning: parse_url(cow:///C:\index.php): Unable to parse url in c:\www\test\parse_url.php on line 5

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-06-28 21:39 UTC] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

/// for anything other then file is not valid. 
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Thu Jul 07 05:05:44 2022 UTC