ID: 50073
Updated by: [email protected]
Reported By: kurt at blackwell dot id dot au
-Status: Verified
+Status: Assigned
Bug Type: URL related
Operating System: *
PHP Version: 5.*, 6
-Assigned To:
+Assigned To: iliaa
Previous Comments:
------------------------------------------------------------------------
[2009-11-04 09:01:39] kurt at blackwell dot id dot au
Description:
------------
parse_url incorrectly parses URLs with no query and a '?' in the
fragment. It will either interpret the fragment as the query, or split
the fragment between the host and query.
Reproduce code:
---------------
print_r(parse_url('http://www.example.com/#a?b'));
print_r(parse_url('http://www.example.com#a?b'));
Expected result:
----------------
Array
(
[scheme] => http
[host] => www.example.com
[path] => /
[fragment] => a?b
)
Array
(
[scheme] => http
[host] => www.example.com
[fragment] => a?b
)
Actual result:
--------------
Array
(
[scheme] => http
[host] => www.example.com
[path] => /
[query] => a?b
)
Array
(
[scheme] => http
[host] => www.example.com#a
[query] => b
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50073&edit=1