Make WordPress Core

Changeset 32822


Ignore:
Timestamp:
06/17/2015 07:47:58 PM (11 years ago)
Author:
ocean90
Message:

Customizer: Decode HTML entities of panel/section titles.

Titles are now passed into Underscore templates but HTML-escaped, see #30737.

fixes #32670.

Location:
trunk/src/wp-includes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-nav-menus.php

    r32806 r32822  
    112112                                $items[] = array(
    113113                                        'id'         => "post-{$post->ID}",
    114                                         'title'      => html_entity_decode( get_the_title( $post ) ),
     114                                        'title'      => html_entity_decode( get_the_title( $post ), ENT_QUOTES, get_bloginfo( 'charset' ) ),
    115115                                        'type'       => 'post_type',
    116116                                        'type_label' => get_post_type_object( $post->post_type )->labels->singular_name,
     
    139139                                $items[] = array(
    140140                                        'id'         => "term-{$term->term_id}",
    141                                         'title'      => html_entity_decode( $term->name ),
     141                                        'title'      => html_entity_decode( $term->name, ENT_QUOTES, get_bloginfo( 'charset' ) ),
    142142                                        'type'       => 'taxonomy',
    143143                                        'type_label' => get_taxonomy( $term->taxonomy )->labels->singular_name,
     
    223223                                        'object'     => $post->post_type,
    224224                                        'object_id'  => intval( $post->ID ),
    225                                         'title'      => html_entity_decode( get_the_title( $post ) ),
     225                                        'title'      => html_entity_decode( get_the_title( $post ), ENT_QUOTES, get_bloginfo( 'charset' ) ),
    226226                                );
    227227                        }
     
    245245                                        'object'     => $term->taxonomy,
    246246                                        'object_id'  => intval( $term->term_id ),
    247                                         'title'      => html_entity_decode( $term->name ),
     247                                        'title'      => html_entity_decode( $term->name, ENT_QUOTES, get_bloginfo( 'charset' ) ),
    248248                                );
    249249                        }
     
    444444                        $section_id = 'nav_menu[' . $menu_id . ']';
    445445                        $this->manager->add_section( new WP_Customize_Nav_Menu_Section( $this->manager, $section_id, array(
    446                                 'title'     => html_entity_decode( $menu->name ),
     446                                'title'     => html_entity_decode( $menu->name, ENT_QUOTES, get_bloginfo( 'charset' ) ),
    447447                                'priority'  => 10,
    448448                                'panel'     => 'nav_menus',
  • trunk/src/wp-includes/class-wp-customize-panel.php

    r32658 r32822  
    215215         */
    216216        public function json() {
    217                 $array = wp_array_slice_assoc( (array) $this, array( 'id', 'title', 'description', 'priority', 'type' ) );
     217                $array = wp_array_slice_assoc( (array) $this, array( 'id', 'description', 'priority', 'type' ) );
     218                $array['title'] = html_entity_decode( $this->title, ENT_QUOTES, get_bloginfo( 'charset' ) );
    218219                $array['content'] = $this->get_content();
    219220                $array['active'] = $this->active();
  • trunk/src/wp-includes/class-wp-customize-section.php

    r32806 r32822  
    224224         */
    225225        public function json() {
    226                 $array = wp_array_slice_assoc( (array) $this, array( 'id', 'title', 'description', 'priority', 'panel', 'type' ) );
     226                $array = wp_array_slice_assoc( (array) $this, array( 'id', 'description', 'priority', 'panel', 'type' ) );
     227                $array['title'] = html_entity_decode( $this->title, ENT_QUOTES, get_bloginfo( 'charset' ) );
    227228                $array['content'] = $this->get_content();
    228229                $array['active'] = $this->active();
Note: See TracChangeset for help on using the changeset viewer.