From 51982620ce1e018094edbbea4b52e18311565622 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Wed, 10 Aug 2011 19:00:45 +0000 Subject: [PATCH] Don't process wpdb->tables('global') inside a loop. props wpmuguru, fixes #14503. git-svn-id: https://develop.svn.wordpress.org/trunk@18522 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/upgrade.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php index f29f594eda..40257a14ab 100644 --- a/wp-admin/includes/upgrade.php +++ b/wp-admin/includes/upgrade.php @@ -1406,9 +1406,10 @@ function dbDelta($queries, $execute = true) { // Check to see which tables and fields exist if ($tables = $wpdb->get_col('SHOW TABLES;')) { // For every table in the database + $global_tables = $wpdb->tables( 'global' ); foreach ($tables as $table) { // Upgrade global tables only for the main site. Don't upgrade at all if DO_NOT_UPGRADE_GLOBAL_TABLES is defined. - if ( in_array($table, $wpdb->tables('global')) && ( !is_main_site() || defined('DO_NOT_UPGRADE_GLOBAL_TABLES') ) ) + if ( in_array( $table, $global_tables ) && ( !is_main_site() || defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) ) continue; // If a table query exists for the database table...