From e7b9056c581bf163594adce00943dfa1658e1b14 Mon Sep 17 00:00:00 2001 From: nishitlangaliya Date: Tue, 30 Oct 2018 20:50:09 +0530 Subject: [PATCH] fix: global table included along with multisite tables --- includes/api/v2/class-wc-rest-system-status-v2-controller.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/api/v2/class-wc-rest-system-status-v2-controller.php b/includes/api/v2/class-wc-rest-system-status-v2-controller.php index d44a503fc22..40308030720 100644 --- a/includes/api/v2/class-wc-rest-system-status-v2-controller.php +++ b/includes/api/v2/class-wc-rest-system-status-v2-controller.php @@ -722,9 +722,10 @@ class WC_REST_System_Status_V2_Controller extends WC_REST_Controller { ); $site_tables_prefix = $wpdb->get_blog_prefix( get_current_blog_id() ); + $global_tables = $wpdb->tables( 'global', true ); foreach ( $database_table_sizes as $table ) { // Only include tables matching the prefix of the current site, this is to prevent displaying all tables on a MS install not relating to the current. - if ( is_multisite() && 0 !== strpos( $table->name, $site_tables_prefix ) ) { + if ( is_multisite() && 0 !== strpos( $table->name, $site_tables_prefix ) && ! in_array( $table->name, $global_tables, true ) ) { continue; } $table_type = in_array( $table->name, $core_tables ) ? 'woocommerce' : 'other';