Make WordPress Core

Ticket #20450: 20450.diff

File 20450.diff, 2.0 KB (added by CoenJacobs, 14 years ago)

Basic fix to rewrite the entire element to double-quote characters

  • wp-includes/category-template.php

     
    328328
    329329        $tab_index_attribute = '';
    330330        if ( (int) $tab_index > 0 )
    331                 $tab_index_attribute = " tabindex=\"$tab_index\"";
     331                $tab_index_attribute = ' tabindex="' . $tab_index .'"';
    332332
    333333        $categories = get_terms( $taxonomy, $r );
    334334        $name = esc_attr( $name );
     
    336336        $id = $id ? esc_attr( $id ) : $name;
    337337
    338338        if ( ! $r['hide_if_empty'] || ! empty($categories) )
    339                 $output = "<select name='$name' id='$id' class='$class' $tab_index_attribute>\n";
     339                $output = '<select name="' . $name . '" id="' . $id . '" class="' . $class . '" ' . $tab_index_attribute . '>' . "\n";
    340340        else
    341341                $output = '';
    342342
    343343        if ( empty($categories) && ! $r['hide_if_empty'] && !empty($show_option_none) ) {
    344344                $show_option_none = apply_filters( 'list_cats', $show_option_none );
    345                 $output .= "\t<option value='-1' selected='selected'>$show_option_none</option>\n";
     345                $output .= "\t" . '<option value="-1" selected="selected">' . $show_option_none . '</option>' . "\n";
    346346        }
    347347
    348348        if ( ! empty( $categories ) ) {
     
    350350                if ( $show_option_all ) {
    351351                        $show_option_all = apply_filters( 'list_cats', $show_option_all );
    352352                        $selected = ( '0' === strval($r['selected']) ) ? " selected='selected'" : '';
    353                         $output .= "\t<option value='0'$selected>$show_option_all</option>\n";
     353                        $output .= "\t" . '<option value="0"' . $selected . '>' . $show_option_all . '</option>' . "\n";
    354354                }
    355355
    356356                if ( $show_option_none ) {
    357357                        $show_option_none = apply_filters( 'list_cats', $show_option_none );
    358358                        $selected = ( '-1' === strval($r['selected']) ) ? " selected='selected'" : '';
    359                         $output .= "\t<option value='-1'$selected>$show_option_none</option>\n";
     359                        $output .= "\t" . '<option value="-1"' . $selected . '>' . $show_option_none . '</option>'. "\n";
    360360                }
    361361
    362362                if ( $hierarchical )