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

From: Date: Mon, 07 Mar 2011 13:43:30 +0000
Subject: Bug #54180 [Opn]: parse_url() incorrectly parses path when ? in fragment
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-159274@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 User updated by: gasper at kozak dot si Reported by: gasper at kozak dot si Summary: parse_url() incorrectly parses path when ? in fragment Status: Open Type: Bug Package: URL related PHP Version: 5.3.5 Block user comment: N Private report: N New Comment: 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 ) Previous Comments: ------------------------------------------------------------------------ [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 (#159274) next »