Bug #17533 Updated: parse_url shouldn't work with http://www..com

From: Date: Tue, 04 Jun 2002 20:15:01 +0000
Subject: Bug #17533 Updated: parse_url shouldn't work with http://www..com
References: 1  Groups: php.bugs php.doc 
Request: Send a blank email to php-bugs+get-9493@lists.php.net to get a copy of this message
ID: 17533 Updated by: mfischer@php.net Reported By: dd@selftrade.com Status: Open -Bug Type: *URL Functions +Bug Type: Documentation problem Operating System: RedHat 7.2 PHP Version: 4.2.1 New Comment: After examinign the code: parse_url is not meant to validate the URL, just to break it up into it's distinct parts if possible. Reclassifying as documentation problem. Previous Comments: ------------------------------------------------------------------------ [2002-06-04 14:20:55] mfischer@php.net Just a note: "qwerty" on it's own still can be right (e.g. you have a subdomain qwerty.mydomain.com and set up your box that mydomain.com is in your domain search path). On the other hand: php -r 'print_r(parse_url("http://www][.ww_-/...._..-.../"));' Array ( [scheme] => http [host] => www][.ww_- [path] => /...._..-.../ ) So it looks like parse_url() only splits the url into it's distinct parts (which obviously works). If this is true, this needs to be documented. Anyone else comments? ------------------------------------------------------------------------ [2002-05-30 17:53:25] dd@selftrade.com If you submit a url like www..com to parse_url, it will parse it without any error, although this kind of URL is incorrect. Try this: <? $url="http://www..com"; $a=parse_url($url); $host=$a[host]; $scheme=$a[scheme]; $path=$a[path]; echo("<LI>SCHEME=$scheme<LI>HOST=$host<LI>PATH=$path"); ?> It will return: SCHEME=http HOST=www..com PATH= The same kind of thing happens if url="qwerty", as it will return "qwerty" as the path. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=17533&edit=1

« previous php.bugs (#9493) next »