Ticket #14503: 14503.diff

File 14503.diff, 869 bytes (added by wpmuguru, 3 years ago)
Line 
1Index: wp-admin/includes/upgrade.php
2===================================================================
3--- wp-admin/includes/upgrade.php       (revision 15483)
4+++ wp-admin/includes/upgrade.php       (working copy)
5@@ -1398,9 +1398,10 @@
6        // Check to see which tables and fields exist
7        if ($tables = $wpdb->get_col('SHOW TABLES;')) {
8                // For every table in the database
9+               $global_tables = $wpdb->tables( 'global' );
10                foreach ($tables as $table) {
11                        // Upgrade global tables only for the main site. Don't upgrade at all if DO_NOT_UPGRADE_GLOBAL_TABLES is defined.
12-                       if ( in_array($table, $wpdb->tables('global')) && ( !is_main_site() || defined('DO_NOT_UPGRADE_GLOBAL_TABLES') ) )
13+                       if ( in_array( $table, $global_tables ) && ( !is_main_site() || defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) )
14                                continue;
15 
16                        // If a table query exists for the database table...