Make WordPress Core


Ignore:
Timestamp:
06/17/2021 11:28:55 AM (4 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php

    r51049 r51174  
    211211            $widget_object = $wp_widget_factory->get_widget_object( $parsed_id['id_base'] );
    212212
    213             $widget['id']       = $parsed_id['id_base'];
    214             $widget['is_multi'] = (bool) $widget_object;
     213            $widget['id']          = $parsed_id['id_base'];
     214            $widget['is_multi']    = (bool) $widget_object;
     215
     216            if ( isset( $widget['name'] ) ) {
     217                $widget['name'] = html_entity_decode( $widget['name'] );
     218            }
     219
     220            if ( isset( $widget['description'] ) ) {
     221                $widget['description'] = html_entity_decode( $widget['description'] );
     222            }
    215223
    216224            unset( $widget['callback'] );
Note: See TracChangeset for help on using the changeset viewer.