|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-08-25 23:22 UTC] 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)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 22 17:00:01 2025 UTC |
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" }