Make WordPress Core


Ignore:
Timestamp:
09/22/2015 06:05:39 AM (11 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-users-list-table.php

    r34289 r34383  
    5050                }
    5151
    52                 if ( $role == 'super' ) {
     52                if ( $role === 'super' ) {
    5353                        $logins = implode( "', '", get_super_admins() );
    5454                        $args['include'] = $wpdb->get_col( "SELECT ID FROM $wpdb->users WHERE user_login IN ('$logins')" );
    … …  
    123123                $role_links = array();
    124124                $role_links['all'] = "<a href='" . network_admin_url('users.php') . "'$class>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_users, 'users' ), number_format_i18n( $total_users ) ) . '</a>';
    125                 $class = $role == 'super' ? ' class="current"' : '';
     125                $class = $role === 'super' ? ' class="current"' : '';
    126126                $role_links['super'] = "<a href='" . network_admin_url('users.php?role=super') . "'$class>" . sprintf( _n( 'Super Admin <span class="count">(%s)</span>', 'Super Admins <span class="count">(%s)</span>', $total_admins ), number_format_i18n( $total_admins ) ) . '</a>';
    127127
    … …  
    138138                parent::pagination ( $which );
    139139
    140                 if ( 'top' == $which )
     140                if ( 'top' === $which ) {
    141141                        $this->view_switcher( $mode );
     142                }
    142143        }
    143144
    … …  
    269270        public function column_registered( $user ) {
    270271                global $mode;
    271                 if ( 'list' == $mode ) {
     272                if ( 'list' === $mode ) {
    272273                        $date = __( 'Y/m/d' );
    273274                } else {
    … …  
    312313                        }
    313314
    314                         $path   = ( $val->path == '/' ) ? '' : $val->path;
     315                        $path   = ( $val->path === '/' ) ? '' : $val->path;
    315316                        echo '<span class="site-' . $val->site_id . '" >';
    316317                        echo '<a href="'. esc_url( network_admin_url( 'site-info.php?id=' . $val->userblog_id ) ) .'">' . str_replace( '.' . get_current_site()->domain, '', $val->domain . $path ) . '</a>';
Note: See TracChangeset for help on using the changeset viewer.