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
This commit is contained in:
John Blackbourn 2017-08-22 14:52:44 +00:00
parent 2cde37040d
commit 76e864854f
2 changed files with 4 additions and 4 deletions

View File

@ -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;

View File

@ -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.