ID:          43411
 Updated by:  [EMAIL PROTECTED]
 Reported By: php at koterov dot ru
-Status:      Open
+Status:      Bogus
 Bug Type:    URL related
 PHP Version: 5.2.5
 New Comment:

There is quite clear note in manual for parse_url(): "Note: This
function doesn't work with relative URLs."


Previous Comments:
------------------------------------------------------------------------

[2007-11-26 12:34:59] php at koterov dot ru

Description:
------------
When I pass a relative URL to parse_url and it contains something like
"http://xxx"; in QUERY_STRING parameters, parse_url reports that the URL
is broken.

So it is not always safe to call 
parse_url($_SERVER['REQUEST_URI'])

I think the solution should be: if an URL is relative (started with
'/'), do not report a warning when its arguments contain ":".

Possibly you will say "won't fix" and "URL is not RFC-complaint", but
this argument is not relevant when I call
parse_url($_SERVER['REQUEST_URI']) (it may be hand-made and non-RFC
complaint).

Reproduce code:
---------------
print_r(parse_url('/test/?retpath=http://xxx'));

Expected result:
----------------
ok

Actual result:
--------------
Warning: parse_url(/test/?retpath=http://xxx): Unable to parse URL


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=43411&edit=1

Reply via email to