#33138 [NEW]: parse_url() wrongly handles relative URIs with ':'

From: Date: Wed, 25 May 2005 13:34:12 +0000
Subject: #33138 [NEW]: parse_url() wrongly handles relative URIs with ':'
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-79485@lists.php.net to get a copy of this message
From: moriyoshi@php.net Operating system: Irrelevant PHP version: 4.3.11 PHP Bug Type: URL related Bug description: parse_url() wrongly handles relative URIs with ':' Description: ------------ parse_url() cannot handle relative URIs (ones without schemes) that contains ':' within the queries. Reproduce code: --------------- var_dump(parse_url('/a/b/c')); var_dump(parse_url('/a/b/c?d:')); var_dump(parse_url('/a/b/c?d:e')); Expected result: ---------------- array(1) { ["path"]=> string(6) "/a/b/c" } array(2) { ["path"]=> string(6) "/a/b/c" ["query"]=> string(6) "d:" } array(2) { ["path"]=> string(6) "/a/b/c" ["query"]=> string(6) "d:e" } Actual result: -------------- array(1) { ["path"]=> string(6) "/a/b/c" } Warning: parse_url(/a/b/c?d:): Unable to parse url in Command line code on line 2 bool(false) array(2) { ["scheme"]=> string(8) "/a/b/c?d" ["path"]=> string(1) "e" } -- Edit bug report at http://bugs.php.net/?id=33138&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33138&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=33138&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=33138&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=33138&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=33138&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=33138&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=33138&r=needscript Try newer version: http://bugs.php.net/fix.php?id=33138&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=33138&r=support Expected behavior: http://bugs.php.net/fix.php?id=33138&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=33138&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=33138&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=33138&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33138&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=33138&r=dst IIS Stability: http://bugs.php.net/fix.php?id=33138&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=33138&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=33138&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=33138&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=33138&r=mysqlcfg

« previous php.bugs (#79485) next »