From 0a818ec0fc621aaafbc2041026adbe173fada4fc Mon Sep 17 00:00:00 2001 From: John James Jacoby Date: Tue, 8 Oct 2019 17:44:42 +0000 Subject: [PATCH] Network Admin: Improve Site States in List Table rows. This commit switches a comparison to a Yoda condition, performs a more strict `intval()` check on the value of the Site Status column, and prevents a specific Site State from appearing in List Table rows when filtering by that same Site State already (to match the behavior of other List Table State implementations.) Fixes #37684. Props pbiron. git-svn-id: https://develop.svn.wordpress.org/trunk@46441 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-ms-sites-list-table.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/includes/class-wp-ms-sites-list-table.php b/src/wp-admin/includes/class-wp-ms-sites-list-table.php index 5f15b5a1c1..34fbad2c68 100644 --- a/src/wp-admin/includes/class-wp-ms-sites-list-table.php +++ b/src/wp-admin/includes/class-wp-ms-sites-list-table.php @@ -617,8 +617,9 @@ class WP_MS_Sites_List_Table extends WP_List_Table { reset( $this->status_list ); + $site_status = isset( $_REQUEST['status'] ) ? wp_unslash( trim( $_REQUEST['status'] ) ) : ''; foreach ( $this->status_list as $status => $col ) { - if ( $_site->{$status} == 1 ) { + if ( ( 1 === intval( $_site->{$status} ) ) && ( $site_status !== $status ) ) { $site_states[ $col[0] ] = $col[1]; } }