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:
ryan 2006-06-22 03:52:18 +00:00
parent 8dce026973
commit c69c8bdfd8

View File

@ -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 {