From 76e864854f7d54f0d9f7930321f77f644744fb2a Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Tue, 22 Aug 2017 14:52:44 +0000 Subject: [PATCH] Widgets: Correctly strip slashes from widget and sidebar names to allow namespaced widgets to function correctly. Fixes #27770 Props jdgrimes Built from https://develop.svn.wordpress.org/trunk@41292 git-svn-id: http://core.svn.wordpress.org/trunk@41132 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/ajax-actions.php | 6 +++--- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php index 4952415149..3f3c0fc7e8 100644 --- a/wp-admin/includes/ajax-actions.php +++ b/wp-admin/includes/ajax-actions.php @@ -1879,7 +1879,7 @@ function wp_ajax_widgets_order() { // Save widgets order for all sidebars. if ( is_array($_POST['sidebars']) ) { $sidebars = array(); - foreach ( $_POST['sidebars'] as $key => $val ) { + foreach ( wp_unslash( $_POST['sidebars'] ) as $key => $val ) { $sb = array(); if ( !empty($val) ) { $val = explode(',', $val); @@ -1935,8 +1935,8 @@ function wp_ajax_save_widget() { /** This action is documented in wp-admin/widgets.php */ do_action( 'sidebar_admin_setup' ); - $id_base = $_POST['id_base']; - $widget_id = $_POST['widget-id']; + $id_base = wp_unslash( $_POST['id_base'] ); + $widget_id = wp_unslash( $_POST['widget-id'] ); $sidebar_id = $_POST['sidebar']; $multi_number = !empty($_POST['multi_number']) ? (int) $_POST['multi_number'] : 0; $settings = isset($_POST['widget-' . $id_base]) && is_array($_POST['widget-' . $id_base]) ? $_POST['widget-' . $id_base] : false; diff --git a/wp-includes/version.php b/wp-includes/version.php index a09530bf85..486b6e8e43 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.9-alpha-41291'; +$wp_version = '4.9-alpha-41292'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.