From 477f0ffd71744e832c1cc19d660528e5f32ecc5f Mon Sep 17 00:00:00 2001 From: johnjamesjacoby Date: Tue, 8 Oct 2019 17:46:02 +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. Built from https://develop.svn.wordpress.org/trunk@46441 git-svn-id: http://core.svn.wordpress.org/trunk@46239 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-ms-sites-list-table.php | 3 ++- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/class-wp-ms-sites-list-table.php b/wp-admin/includes/class-wp-ms-sites-list-table.php index 5f15b5a1c1..34fbad2c68 100644 --- a/wp-admin/includes/class-wp-ms-sites-list-table.php +++ b/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]; } } diff --git a/wp-includes/version.php b/wp-includes/version.php index 4f35f0c82f..b955cf31e8 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.3-beta2-46440'; +$wp_version = '5.3-beta2-46441'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.