Hartmut Holzgraefe wrote:
>
>valid and expected behaviour
>
>if no scheme is given the argument is treated as a filesystem path,
>here a file named "www.homecentricity.com" in the current working
>directory
>
>just because browsers take input like this in their location bars
>as http URLs doesn't say everything should

Hmmm... the PHP Documentation states (with my *highlighting*):

"This function returns an associative array returning *any* of the various
components of the URL *that are present*
*Partial urls are also accepted*, parse_url() *tries its best to parse them
correctly*"

Based on the documentation, it is *not* valid and expected behavior. Given
that the function is "parse_url" and not "parse_file", and that the
intention of the function is not to validate but to decipher it into it's
component parts, the default for no scheme should not be to assume it is a
file but to assume that it is a partial or malformed url. If the function
worked according to the documentation, I would expect that
www.homecentricity.com would return the following:

scheme = NULL
host = www.homecentricity.com

Either something is not working correctly or the documentation needs to be
corrected to state your comments above.
-Steve



-- 
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to