Make WordPress Core

Ticket #54277: 54277.2.diff

File 54277.2.diff, 1.1 KB (added by sabbirshouvo, 4 years ago)

improved code readability & fix variable escaping.

  • src/wp-admin/theme-install.php

    diff --git a/src/wp-admin/theme-install.php b/src/wp-admin/theme-install.php
    index 4f0ba2ad66..596821b402 100644
    a b require_once ABSPATH . 'wp-admin/admin-header.php'; 
    221221                // and to ensure tags are translated.
    222222                $feature_list = get_theme_feature_list( false );
    223223
    224                 foreach ( $feature_list as $feature_name => $features ) {
     224                foreach ( $feature_list as $feature_category => $features ) {
    225225                        echo '<fieldset class="filter-group">';
    226                         $feature_name = esc_html( $feature_name );
    227                         echo '<legend>' . $feature_name . '</legend>';
     226                        $feature_category = esc_html( $feature_category );
     227                        echo '<legend>' . $feature_category . '</legend>';
    228228                        echo '<div class="filter-group-feature">';
    229229                        foreach ( $features as $feature => $feature_name ) {
    230230                                $feature = esc_attr( $feature );
     231                                $feature_name = esc_html( $feature_name );
    231232                                echo '<input type="checkbox" id="filter-id-' . $feature . '" value="' . $feature . '" /> ';
    232233                                echo '<label for="filter-id-' . $feature . '">' . $feature_name . '</label>';
    233234                        }