Bug #54180 [Opn->Csd]: parse_url() incorrectly parses path when ? in fragment

From: Date: Sun, 13 Mar 2011 04:03:33 +0000
Subject: Bug #54180 [Opn->Csd]: parse_url() incorrectly parses path when ? in fragment
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-159445@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=54180&edit=1 ID: 54180 Updated by: pierrick@php.net Reported by: gasper at kozak dot si Summary: parse_url() incorrectly parses path when ? in fragment -Status: Open +Status: Closed Type: Bug Package: URL related PHP Version: 5.3.5 -Assigned To: +Assigned To: pierrick Block user comment: N Private report: N Previous Comments: ------------------------------------------------------------------------ [2011-03-13 05:02:59] pierrick@php.net Automatic comment from SVN on behalf of pierrick Revision: http://svn.php.net/viewvc/?view=revision&revision=309159 Log: Fixed bug #54180 (parse_url() incorrectly parses path when ? in fragment) ------------------------------------------------------------------------ [2011-03-07 14:43:29] gasper at kozak dot si This works if '?' is also present _before_ the fragment: $p = parse_url('http://example.com/path/script.html?query#fragment?data'); print_r($p); Outputs correctly: Array ( [scheme] => http [host] => example.com [path] => /path/script.html [query] => query [fragment] => fragment?data ) ------------------------------------------------------------------------ [2011-03-07 14:29:46] gasper at kozak dot si Description: ------------ It seems that parse_url() ignores the path when fragment identifier includes a question mark (?). A few similar bugs were already reported (and fixed), but none of them is the same; this one affects the path part of the url. Test script: --------------- $p = parse_url('http://example.com/path/script.html#fragment?data'); print_r($p); Expected result: ---------------- Array ( [scheme] => http [host] => example.com [path] => /path/script.html [fragment] => fragment?data ) Actual result: -------------- Array ( [scheme] => http [host] => example.com [fragment] => fragment?data ) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=54180&edit=1

« previous php.bugs (#159445) next »