From 9f1145b8aec2bdfba3256e870189a36b5712664f Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 17 Jun 2021 11:30:00 +0000 Subject: [PATCH] REST API: Decode HTML entities in widget names and descriptions in widget types controller. Follow-up to [50995]. Props ramonopoly, noisysocks, spacedmonkey, justinahinon, audrasjb, SergeyBiryukov. Fixes #53407. Built from https://develop.svn.wordpress.org/trunk@51174 git-svn-id: http://core.svn.wordpress.org/trunk@50783 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../class-wp-rest-widget-types-controller.php | 12 ++++++++++-- wp-includes/version.php | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php index f09277c173..0578c06f69 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php @@ -210,8 +210,16 @@ class WP_REST_Widget_Types_Controller extends WP_REST_Controller { $parsed_id = wp_parse_widget_id( $widget['id'] ); $widget_object = $wp_widget_factory->get_widget_object( $parsed_id['id_base'] ); - $widget['id'] = $parsed_id['id_base']; - $widget['is_multi'] = (bool) $widget_object; + $widget['id'] = $parsed_id['id_base']; + $widget['is_multi'] = (bool) $widget_object; + + if ( isset( $widget['name'] ) ) { + $widget['name'] = html_entity_decode( $widget['name'] ); + } + + if ( isset( $widget['description'] ) ) { + $widget['description'] = html_entity_decode( $widget['description'] ); + } unset( $widget['callback'] ); diff --git a/wp-includes/version.php b/wp-includes/version.php index d7bdbdc60b..9f64787bb7 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.8-beta2-51173'; +$wp_version = '5.8-beta2-51174'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.