mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-05 02:10:45 +01:00
Fix bug in add_query_arg when url like http://example.com (no trailing slash). Props skel to the ac.
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@3898 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
8dce026973
commit
c69c8bdfd8
@ -2083,6 +2083,13 @@ function add_query_arg() {
|
||||
$uri = @func_get_arg(2);
|
||||
}
|
||||
|
||||
if ( preg_match('|^https?://|i', $uri, $matches) ) {
|
||||
$protocol = $matches[0];
|
||||
$uri = substr($uri, strlen($protocol));
|
||||
} else {
|
||||
$protocol = '';
|
||||
}
|
||||
|
||||
if ( strstr($uri, '?') ) {
|
||||
$parts = explode('?', $uri, 2);
|
||||
if ( 1 == count($parts) ) {
|
||||
@ -2092,8 +2099,7 @@ function add_query_arg() {
|
||||
$base = $parts[0] . '?';
|
||||
$query = $parts[1];
|
||||
}
|
||||
}
|
||||
else if ( strstr($uri, '/') ) {
|
||||
} else if ( !empty($protocol) || strstr($uri, '/') ) {
|
||||
$base = $uri . '?';
|
||||
$query = '';
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user