#36351 [Asn->Csd]: parse_url does not parse path correctly.
| From: | iliaa@php.net | Date: | Sun, 12 Feb 2006 16:41:41 +0000 |
| Subject: | #36351 [Asn->Csd]: parse_url does not parse path correctly. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-93179@lists.php.net to get a copy of this message | ||
ID: 36351
Updated by: iliaa@php.net
Reported By: adam at nojszewski dot com
-Status: Assigned
+Status: Closed
Bug Type: URL related
PHP Version: 5.1.2
Assigned To: iliaa
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2006-02-10 15:19:32] tony2001@php.net
Ilia, please take a look at it.
------------------------------------------------------------------------
[2006-02-10 14:48:21] adam at nojszewski dot com
I have found a cause of this behavior
URL like string:number are generaly treated as host:port when nuber is
[0,65535].
When number is [65536,99999] function wraps it to values [0,34463].
When nuber is more than 5 digits long function treats it as part of a
path.
But web browsers treat specific combinations (i.e. 'mailto:555') not as
host:port, but as scheme:path.
------------------------------------------------------------------------
[2006-02-10 14:09:26] adam at nojszewski dot com
Description:
------------
parse_url does not parses 'scheme:path' when path consists of numbers
only.
skype:anojszewski is parsed right.
gg:9130731 is parsed wrong (whole URL is treated as path).
Tested on versions 5.1.2 and 4.4.2.
Adam Nojszewski
Reproduce code:
---------------
print_r(parse_url("skype:anojszewski"));
print_r(parse_url("gg:9130731"));
Expected result:
----------------
Array
(
[scheme] => skype
[path] => anojszewski
)
Array
(
[scheme] => gg
[path] => 9130731
)
Actual result:
--------------
Array
(
[scheme] => skype
[path] => anojszewski
)
Array
(
[path] => gg:9130731
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36351&edit=1