mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-27 18:16:08 +00:00
Keep the frag at the end. Props mdawaffe. fixes #3078
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4231 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1b88cb8ea2
commit
5077b4e5de
@ -2085,6 +2085,11 @@ function add_query_arg() {
|
||||
$uri = @func_get_arg(2);
|
||||
}
|
||||
|
||||
if ( $frag = strstr($uri, '#') )
|
||||
$uri = substr($uri, 0, -strlen($frag));
|
||||
else
|
||||
$frag = '';
|
||||
|
||||
if ( preg_match('|^https?://|i', $uri, $matches) ) {
|
||||
$protocol = $matches[0];
|
||||
$uri = substr($uri, strlen($protocol));
|
||||
@ -2124,7 +2129,7 @@ function add_query_arg() {
|
||||
$ret .= "$k=$v";
|
||||
}
|
||||
}
|
||||
$ret = $protocol . $base . $ret;
|
||||
$ret = $protocol . $base . $ret . $frag;
|
||||
return trim($ret, '?');
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user