|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-03-07 14:29 UTC] 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
)
Patchesbug54180_patch (last revision 2011-03-07 22:33 UTC by tomas dot brastavicius at quantum dot lt)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 20:00:01 2025 UTC |
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 )