WordPress.org

Make WordPress Core

Ticket #37684: 37684.5.diff

File 37684.5.diff, 558 bytes (added by johnjamesjacoby, 10 months ago)

Strict comparison, Yoda condition, and avoid redundant State visibility

  • src/wp-admin/includes/class-wp-ms-sites-list-table.php

     
    617617
    618618                reset( $this->status_list );
    619619
     620                $site_status = isset( $_REQUEST['status'] ) ? wp_unslash( trim( $_REQUEST['status'] ) ) : '';
    620621                foreach ( $this->status_list as $status => $col ) {
    621                         if ( $_site->{$status} == 1 ) {
     622                        if ( ( 1 === intval( $_site->{$status} ) ) && ( $site_status !== $status ) ) {
    622623                                $site_states[ $col[0] ] = $col[1];
    623624                        }
    624625                }