diff --git a/wp-includes/functions.php b/wp-includes/functions.php index dbd8e0f1bc..f14790828d 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -826,6 +826,7 @@ function add_query_arg() { $ret .= "$k=$v"; } } + $ret = trim($ret, '?'); $ret = $protocol . $base . $ret . $frag; $ret = trim($ret, '?'); return $ret;