Make WordPress Core

Ticket #54256: 54256.diff

File 54256.diff, 3.6 KB (added by sabbirshouvo, 3 years ago)

Patch added

  • src/wp-admin/themes.php

    diff --git a/src/wp-admin/themes.php b/src/wp-admin/themes.php
    index 87b1b6db7a..d55ee4835f 100644
    a b foreach ( $themes as $theme ) : 
    371371                $active_class = ' active';
    372372        }
    373373        ?>
    374 <div class="theme<?php echo $active_class; ?>">
     374<div class="theme<?php echo esc_attr($active_class); ?>">
    375375        <?php if ( ! empty( $theme['screenshot'][0] ) ) { ?>
    376376                <div class="theme-screenshot">
    377                         <img src="<?php echo $theme['screenshot'][0]; ?>" alt="" />
     377                        <img src="<?php echo esc_url($theme['screenshot'][0]); ?>" alt="" />
    378378                </div>
    379379        <?php } else { ?>
    380380                <div class="theme-screenshot blank"></div>
    foreach ( $themes as $theme ) : 
    508508        /* translators: %s: Theme name. */
    509509        $details_aria_label = sprintf( _x( 'View Theme Details for %s', 'theme' ), $theme['name'] );
    510510        ?>
    511         <button type="button" aria-label="<?php echo esc_attr( $details_aria_label ); ?>" class="more-details" id="<?php echo $aria_action; ?>"><?php _e( 'Theme Details' ); ?></button>
     511        <button type="button" aria-label="<?php echo esc_attr( $details_aria_label ); ?>" class="more-details" id="<?php echo esc_attr($aria_action); ?>"><?php _e( 'Theme Details' ); ?></button>
    512512        <div class="theme-author">
    513513                <?php
    514514                /* translators: %s: Theme author name. */
    foreach ( $themes as $theme ) : 
    518518
    519519        <div class="theme-id-container">
    520520                <?php if ( $theme['active'] ) { ?>
    521                         <h2 class="theme-name" id="<?php echo $aria_name; ?>">
     521                        <h2 class="theme-name" id="<?php echo esc_attr($aria_name); ?>">
    522522                                <span><?php _ex( 'Active:', 'theme' ); ?></span> <?php echo $theme['name']; ?>
    523523                        </h2>
    524524                <?php } else { ?>
    525                         <h2 class="theme-name" id="<?php echo $aria_name; ?>"><?php echo $theme['name']; ?></h2>
     525                        <h2 class="theme-name" id="<?php echo esc_attr($aria_name); ?>"><?php echo $theme['name']; ?></h2>
    526526                <?php } ?>
    527527
    528528                <div class="theme-actions">
    function wp_theme_auto_update_setting_template() { 
    11171117                                        $aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
    11181118                                        ?>
    11191119                                        <# if ( data.actions.activate ) { #>
    1120                                                 <a href="{{{ data.actions.activate }}}" class="button activate" aria-label="<?php echo $aria_label; ?>"><?php _e( 'Activate' ); ?></a>
     1120                                                <a href="{{{ data.actions.activate }}}" class="button activate" aria-label="<?php echo esc_attr($aria_label); ?>"><?php _e( 'Activate' ); ?></a>
    11211121                                        <# } #>
    11221122                                        <a href="{{{ data.actions.customize }}}" class="button button-primary load-customize hide-if-no-customize"><?php _e( 'Live Preview' ); ?></a>
    11231123                                <# } else { #>
    function wp_theme_auto_update_setting_template() { 
    11261126                                        $aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' );
    11271127                                        ?>
    11281128                                        <# if ( data.actions.activate ) { #>
    1129                                                 <a class="button disabled" aria-label="<?php echo $aria_label; ?>"><?php _ex( 'Cannot Activate', 'theme' ); ?></a>
     1129                                                <a class="button disabled" aria-label="<?php echo esc_attr($aria_label); ?>"><?php _ex( 'Cannot Activate', 'theme' ); ?></a>
    11301130                                        <# } #>
    11311131                                        <a class="button button-primary hide-if-no-customize disabled"><?php _e( 'Live Preview' ); ?></a>
    11321132                                <# } #>
    function wp_theme_auto_update_setting_template() { 
    11371137                                /* translators: %s: Theme name. */
    11381138                                $aria_label = sprintf( _x( 'Delete %s', 'theme' ), '{{ data.name }}' );
    11391139                                ?>
    1140                                 <a href="{{{ data.actions['delete'] }}}" class="button delete-theme" aria-label="<?php echo $aria_label; ?>"><?php _e( 'Delete' ); ?></a>
     1140                                <a href="{{{ data.actions['delete'] }}}" class="button delete-theme" aria-label="<?php echo esc_attr($aria_label); ?>"><?php _e( 'Delete' ); ?></a>
    11411141                        <# } #>
    11421142                </div>
    11431143        </div>