From 7fba67e4b7ed27407e57dcfcd3f3870b6e9de6cc Mon Sep 17 00:00:00 2001 From: "Dominik Schilling (ocean90)" Date: Wed, 15 Apr 2015 16:32:03 +0000 Subject: [PATCH] Customizer: Escape theme preview URLs. props johnbillion, ocean90. see #31896. git-svn-id: https://develop.svn.wordpress.org/trunk@32134 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/theme.php | 4 +++- src/wp-includes/class-wp-customize-control.php | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/includes/theme.php b/src/wp-admin/includes/theme.php index 4024b395f4..a8c1fc0d50 100644 --- a/src/wp-admin/includes/theme.php +++ b/src/wp-admin/includes/theme.php @@ -511,6 +511,8 @@ function wp_prepare_themes_for_js( $themes = null ) { * @since 4.2.0 */ function customize_themes_print_templates() { + $preview_url = esc_url( add_query_arg( 'theme', '__THEME__' ) ); // Token because esc_url() strips curly braces. + $preview_url = str_replace( '__THEME__', '{{ data.id }}', $preview_url ); ?>