Make WordPress Core


Ignore:
Timestamp:
09/22/2015 06:05:39 AM (9 years ago)
Author:
wonderboymusic
Message:

List Tables: when comparing string literals (non-numeric in nature) against vars, strict comparison can/should be used.

Props wonderboymusic, Viper007Bond.
Fixes #21249.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-ms-themes-list-table.php

    r34128 r34383  
    4242        $page = $this->get_pagenum();
    4343
    44         $this->is_site_themes = ( 'site-themes-network' == $this->screen->id ) ? true : false;
     44        $this->is_site_themes = ( 'site-themes-network' === $this->screen->id ) ? true : false;
    4545
    4646        if ( $this->is_site_themes )
     
    146146            $order = strtoupper( $order );
    147147
    148             if ( $orderby == 'Name' ) {
    149                 if ( 'ASC' == $order )
     148            if ( $orderby === 'Name' ) {
     149                if ( 'ASC' === $order ) {
    150150                    $this->items = array_reverse( $this->items );
     151                }
    151152            } else {
    152153                uasort( $this->items, array( $this, '_order_callback' ) );
     
    207208            return 0;
    208209
    209         if ( 'DESC' == $order )
     210        if ( 'DESC' === $order )
    210211            return ( $a < $b ) ? 1 : -1;
    211212        else
     
    297298                $status_links[$type] = sprintf( "<a href='%s' %s>%s</a>",
    298299                    esc_url( add_query_arg('theme_status', $type, $url) ),
    299                     ( $type == $status ) ? ' class="current"' : '',
     300                    ( $type === $status ) ? ' class="current"' : '',
    300301                    sprintf( $text, number_format_i18n( $count ) )
    301302                );
     
    460461        global $status, $totals;
    461462        if ( $theme->errors() ) {
    462             $pre = $status == 'broken' ? __( 'Broken Theme:' ) . ' ' : '';
     463            $pre = $status === 'broken' ? __( 'Broken Theme:' ) . ' ' : '';
    463464            echo '<p><strong class="error-message">' . $pre . $theme->errors()->get_error_message() . '</strong></p>';
    464465        }
Note: See TracChangeset for help on using the changeset viewer.