Bug #12706 Updated: parse_url misbehaves
| From: | jeroen@php.net | Date: | Sun, 12 Aug 2001 22:11:05 +0000 |
| Subject: | Bug #12706 Updated: parse_url misbehaves | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-63023@lists.php.net to get a copy of this message | ||
ID: 12706
Updated by: jeroen
Reported By: php.net.josef@lushnet.com
Old Status: Open
Status: Analyzed
Bug Type: *URL Functions
Operating System: Linux
PHP Version: 4.0.6
Old Assigned To:
Assigned To: jeroen
New Comment:
www.lalala.com isn't a valid url. The docs say nothing about such a case, so it's
undefined.
Use var_dump on $url to see what happens, PHP thinks www.bla.com is the path. (both linux 403 &
407, and win32 404pl1)
A warning would be appropriate if the url is invalid, looking into that...
Previous Comments:
------------------------------------------------------------------------
[2001-08-12 07:47:06] php.net.josef@lushnet.com
It seems that parse_url returns an empty host when the scheme is missing:
$url = parse_url("http://www.lalala.com"); print
$url["host"];
-> outputs "www.lalala.com"
$url = parse_url("www.lalala.com"); print $url["host"];
-> outputs ""
I tried to reproduce the bug on windows2k, but there it worked just like it should. It could of
course also be that I'm a complete idiot since I've only been using PHP for a few days,
but the result seems to be persistant.
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=12706&edit=1