Bug #55511 [Com]: broken parse_url
| From: | alex dot nerten at gmail dot com | Date: | Mon, 10 Feb 2014 14:31:21 +0000 |
| Subject: | Bug #55511 [Com]: broken parse_url | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-184240@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=55511&edit=1
ID: 55511
Comment by: alex dot nerten at gmail dot com
Reported by: p4ul dot sincl4ir at gmail dot com
Summary: broken parse_url
Status: Not a bug
Type: Bug
Package: *URL Functions
Operating System: linux
PHP Version: 5.4SVN-2011-08-25 (snap)
Block user comment: N
Private report: N
New Comment:
I think this is an error in the function, it has a different behaviour:
Test script:
---------------
var_dump(parse_url('/path?arg=value:1'));
Actual result:
--------------
bool(false)
But
Test script:
---------------
var_dump(parse_url('/path?arg=value:234323'));
Actual result:
--------------
array(2) { ["path"]=> string(5) "/path" ["query"]=> string(16)
"arg=value:234323" }
Previous Comments:
------------------------------------------------------------------------
[2011-08-28 01:13:27] aharvey@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
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.
------------------------------------------------------------------------
[2011-08-26 00:38:18] nikolai dot luthman at gmail dot com
> From what I can gather from
> ”ðêT«¬‡X�http://www.w3.org/Addressing/URL/url-spec.txt, : is
not allowed in urls.
The path part obviously...
------------------------------------------------------------------------
[2011-08-26 00:34:29] nikolai dot luthman at gmail dot com
From what I can gather from http://www.w3.org/Addressing/URL/url-spec.txt,
: is
not allowed in urls.
------------------------------------------------------------------------
[2011-08-25 23:22:48] p4ul dot sincl4ir at gmail dot com
Description:
------------
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:
--------------
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=55511&edit=1