php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61735 parse_url file:// fails with Windows dir separators
Submitted: 2012-04-15 02:27 UTC Modified: 2012-04-15 09:57 UTC
From: nanocaiordo at gmail dot com Assigned:
Status: Not a bug Package: URL related
PHP Version: 5.3.10 OS: Windows 7
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: nanocaiordo at gmail dot com
New email:
PHP Version: OS:

 

 [2012-04-15 02:27 UTC] nanocaiordo at gmail dot com
Description:
------------
Using the file:// scheme, parse_url() fails when the path has windows 
DIRECTORY_SEPARATOR, \

Test script:
---------------
var_dump(parse_url('file://'. dirname(__FILE__)));

Expected result:
----------------
array()

Actual result:
--------------
bool(false)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-04-15 09:57 UTC] pajoye@php.net
\ is not a valid character in an URL.

While php streams functions are more flexible when used with the file or stream 
related (fopen and co), parse_url strictly applies the URI RFC.
 [2012-04-15 09:57 UTC] pajoye@php.net
-Status: Open +Status: Not a bug
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Jan 29 02:03:33 2022 UTC