Make WordPress Core

Changeset 26316


Ignore:
Timestamp:
11/22/2013 02:33:19 AM (12 years ago)
Author:
dd32
Message:

Themes: Move the escaping of content from JS back to PHP. This allows us to take advantage of the display() WP_Theme method to translate the text properly, and to strip out any HTML tags we don't wish to display. Fixes #26100. See #25948

Location:
trunk/src/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/theme.php

    r26282 r26316  
    406406            'screenshot'   => array( $theme->get_screenshot() ), // @todo multiple
    407407            'description'  => $theme->display( 'Description' ),
    408             'author'       => $theme->get( 'Author' ),
    409             'authorURI'    => $theme->get( 'AuthorURI' ),
    410             'version'      => $theme->get( 'Version' ),
    411             'tags'         => $theme->get( 'Tags' ),
     408            'author'       => $theme->display( 'Author' ),
     409            'version'      => $theme->display( 'Version' ),
     410            'tags'         => $theme->display( 'Tags' ),
    412411            'parent'       => $parent,
    413412            'active'       => $slug === $current_theme,
  • trunk/src/wp-admin/themes.php

    r26314 r26316  
    216216        <img src="{{ data.screenshot[0] }}" alt="" />
    217217    </div>
    218     <div class="theme-author"><?php printf( __( 'By %s' ), '{{ data.author }}' ); ?></div>
     218    <div class="theme-author"><?php printf( __( 'By %s' ), '{{{ data.author }}}' ); ?></div>
    219219    <h3 class="theme-name">{{ data.name }}</h3>
    220220    <div class="theme-actions">
     
    267267                <span class="current-label"><?php _e( 'Current Theme' ); ?></span>
    268268            <# } #>
    269             <h3 class="theme-name">{{ data.name }}<span class="theme-version"><?php _e('Version: '); ?> {{ data.version }}</span></h3>
    270             <# if ( data.authorURI ) { #>
    271                 <h4 class="theme-author"><?php printf( __( 'By %s' ), '<a href="{{ data.authorURI }}">{{ data.author }}</a>' ); ?></h4>
    272             <# } else { #>
    273                 <h4 class="theme-author"><?php printf( __( 'By %s' ), '{{ data.author }}' ); ?></h4>
    274             <# } #>
     269            <h3 class="theme-name">{{{ data.name }}}<span class="theme-version"><?php printf( __( 'Version: %s' ), '{{{ data.version }}}' ); ?></span></h3>
     270            <h4 class="theme-author"><?php printf( __( 'By %s' ), '{{{ data.author }}}' ); ?></h4>
    275271
    276272            <# if ( data.hasUpdate ) { #>
     
    283279
    284280            <# if ( data.parent ) { #>
    285                 <p class="parent-theme"><?php printf( __( 'This is a child theme of <strong>%s</strong>.' ), '{{ data.parent }}' ); ?></p>
     281                <p class="parent-theme"><?php printf( __( 'This is a child theme of <strong>%s</strong>.' ), '{{{ data.parent }}}' ); ?></p>
    286282            <# } #>
    287283
    288             <# if ( data.tags.length !== 0 ) { #>
     284            <# if ( data.tags ) { #>
    289285                <p class="theme-tags">
    290286                    <span><?php _e( 'Tags:' ); ?></span>
    291                     {{{ data.tags.join( ', ' ).replace( /-/g, ' ' ) }}}
     287                    {{{ data.tags.replace( /-/g, ' ' ) }}}
    292288                </p>
    293289            <# } #>
Note: See TracChangeset for help on using the changeset viewer.