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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 17:01:58 2024 UTC