From bd1527d4ab640a391b1de424bc3914ed2ed73fd9 Mon Sep 17 00:00:00 2001 From: "Dominik Schilling (ocean90)" Date: Mon, 23 May 2016 10:22:36 +0000 Subject: [PATCH] Template: In `wp_get_archives()` use `add_query_arg()` instead of `sprintf()` to build the archive URL. Props tloureiro. Fixes #36414. git-svn-id: https://develop.svn.wordpress.org/trunk@37530 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/general-template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php index 4aa0cb896e..120d8e7e8b 100644 --- a/src/wp-includes/general-template.php +++ b/src/wp-includes/general-template.php @@ -1790,7 +1790,7 @@ function wp_get_archives( $args = '' ) { $arc_week = get_weekstartend( $result->yyyymmdd, get_option( 'start_of_week' ) ); $arc_week_start = date_i18n( get_option( 'date_format' ), $arc_week['start'] ); $arc_week_end = date_i18n( get_option( 'date_format' ), $arc_week['end'] ); - $url = sprintf( '%1$s/%2$s%3$sm%4$s%5$s%6$sw%7$s%8$d', home_url(), '', '?', '=', $arc_year, '&', '=', $result->week ); + $url = add_query_arg( array( 'm' => $arc_year, 'w' => $result->week, ), home_url( '/' ) ); if ( 'post' !== $r['post_type'] ) { $url = add_query_arg( 'post_type', $r['post_type'], $url ); }