|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55511 broken parse_url
Submitted: 2011-08-25 23:22 UTC Modified: 2011-08-28 01:13 UTC
From: p4ul dot sincl4ir at gmail dot com Assigned:
Status: Not a bug Package: *URL Functions
PHP Version: 5.4SVN-2011-08-25 (snap) OS: linux
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.
Block user comment
Status: Assign to:
Bug Type:
From: p4ul dot sincl4ir at gmail dot com
New email:
PHP Version: OS:


 [2011-08-25 23:22 UTC] p4ul dot sincl4ir at gmail dot com
It seems if you pass a url that has a colon followed by a number into parse_url 
it is unable to parse it. i.e /1:2 returns false
but /1:a2 works so maybe something to do with 
the regex?

Test script:
$testString = "/1:2";
$x = parse_url($testString);
var_dump( $x );

Expected result:
array(1) { ["path"]=> string(5) "/1:2" } 

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-08-26 00:34 UTC] nikolai dot luthman at gmail dot com
From what I can gather from, : is 
not allowed in urls.
 [2011-08-26 00:38 UTC] nikolai dot luthman at gmail dot com
> From what I can gather from, : is 
not allowed in urls.

The path part obviously...
 [2011-08-28 01:13 UTC]
-Status: Open +Status: Bogus
 [2011-08-28 01:13 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

That isn't a valid URL, since there's no scheme, and hence parse_url() is within its rights to return false in that case.
 [2014-02-10 14:31 UTC] alex dot nerten at gmail dot com
I think this is an error in the function, it has a different behaviour:

Test script:

Actual result:


Test script:

Actual result:
array(2) { ["path"]=> string(5) "/path" ["query"]=> string(16) "arg=value:234323" }
 [2016-09-02 08:43 UTC] bugs dot php dot net at chsc dot dk
The quoted spec has been superseded by RFC 3986 and that does allow colons in the path.

This issue has been duplicated in bug #71646.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Jul 28 10:01:24 2021 UTC