From:             php at koterov dot ru
Operating system: 
PHP version:      5.2.5
PHP Bug Type:     URL related
Bug description:  parse_url with relative URLs contained http:// in parameters

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 bug report at http://bugs.php.net/?id=43411&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=43411&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=43411&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=43411&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=43411&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=43411&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=43411&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=43411&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=43411&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=43411&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=43411&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=43411&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=43411&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=43411&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=43411&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=43411&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=43411&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=43411&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=43411&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=43411&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=43411&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=43411&r=mysqlcfg

Reply via email to