From 4b66a66b20e73ec995d2dc5bc2704ef7356722d8 Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Wed, 11 Feb 2015 22:48:27 +0000 Subject: [PATCH] Escape Customizer links in the admin menu. Fix usage of `add_query_arg()`. props iseulde. fixes #30952. Built from https://develop.svn.wordpress.org/trunk@31427 git-svn-id: http://core.svn.wordpress.org/trunk@31408 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/menu.php | 14 +++++++------- wp-includes/version.php | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/wp-admin/menu.php b/wp-admin/menu.php index 89c13d9684..ba14a097c8 100644 --- a/wp-admin/menu.php +++ b/wp-admin/menu.php @@ -147,24 +147,24 @@ $menu[59] = array( '', 'read', 'separator2', '', 'wp-menu-separator' ); $appearance_cap = current_user_can( 'switch_themes') ? 'switch_themes' : 'edit_theme_options'; -$menu[60] = array( __('Appearance'), $appearance_cap, 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'dashicons-admin-appearance' ); +$menu[60] = array( __( 'Appearance' ), $appearance_cap, 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'dashicons-admin-appearance' ); $submenu['themes.php'][5] = array( __( 'Themes' ), $appearance_cap, 'themes.php' ); $customize_url = add_query_arg( 'return', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), 'customize.php' ); - $submenu['themes.php'][6] = array( __( 'Customize' ), 'customize', $customize_url, '', 'hide-if-no-customize' ); + $submenu['themes.php'][6] = array( __( 'Customize' ), 'customize', esc_url( $customize_url ), '', 'hide-if-no-customize' ); if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) { - $submenu['themes.php'][10] = array(__( 'Menus' ), 'edit_theme_options', 'nav-menus.php'); + $submenu['themes.php'][10] = array( __( 'Menus' ), 'edit_theme_options', 'nav-menus.php' ); } if ( current_theme_supports( 'custom-header' ) && current_user_can( 'customize') ) { - $customize_header_url = add_query_arg( 'autofocus[control]', 'header_image', $customize_url ); - $submenu['themes.php'][15] = array( __( 'Header' ), $appearance_cap, $customize_header_url, '', 'hide-if-no-customize' ); + $customize_header_url = add_query_arg( array( 'autofocus' => array( 'control' => 'header_image' ) ), $customize_url ); + $submenu['themes.php'][15] = array( __( 'Header' ), $appearance_cap, esc_url( $customize_header_url ), '', 'hide-if-no-customize' ); } if ( current_theme_supports( 'custom-background' ) && current_user_can( 'customize') ) { - $customize_background_url = add_query_arg( 'autofocus[control]', 'background_image', $customize_url ); - $submenu['themes.php'][20] = array( __( 'Background' ), $appearance_cap, $customize_background_url, '', 'hide-if-no-customize' ); + $customize_background_url = add_query_arg( array( 'autofocus' => array( 'control' => 'background_image' ) ), $customize_url ); + $submenu['themes.php'][20] = array( __( 'Background' ), $appearance_cap, esc_url( $customize_background_url ), '', 'hide-if-no-customize' ); } unset( $customize_url ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 588ae41588..a01a727ae4 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-alpha-31426'; +$wp_version = '4.2-alpha-31427'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.