Bug #12706 Updated: parse_url misbehaves
| From: | mfischer@php.net | Date: | Sun, 09 Jun 2002 23:37:57 +0000 |
| Subject: | Bug #12706 Updated: parse_url misbehaves | ||
| References: | 1 | Groups: | php.bugs php.doc |
| Request: | Send a blank email to php-bugs+get-9960@lists.php.net to get a copy of this message | ||
ID: 12706
Updated by: mfischer@php.net
Reported By: php.net.josef@lushnet.com
-Status: Analyzed
+Status: Closed
Bug Type: Documentation problem
Operating System: Linux
PHP Version: 4.0.6
New Comment:
This bug has been fixed in CVS. You can grab a snapshot of the
CVS version at http://snaps.php.net/. In case this was a
documentation
problem, the fix will show up soon at http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2001-08-12 18:50:14] jeroen@php.net
After some thinking: This is expected behaviour!
www.lalala.com is a valid directory-name, and therefore it is a
relative-path.
Try this in your browser with a <A HREF>, and you'll see that your
browser interpretets it identically.
So this is not a bug. (In the manual, it should be clarified that also
partial urls are accepted, and some examples?)
Changed to docbug.
------------------------------------------------------------------------
[2001-08-12 18:11:05] jeroen@php.net
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...
------------------------------------------------------------------------
[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