From f627d2355554d04adeea8715e6e622a0c3cd1755 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Tue, 3 Dec 2013 17:43:52 +0000 Subject: [PATCH] In dbDelta(), ensure we are not running CREATE TABLE queries for global tables we wish to not upgrade. props fliespl. fixes #22134. git-svn-id: https://develop.svn.wordpress.org/trunk@26566 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/upgrade.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/includes/upgrade.php b/src/wp-admin/includes/upgrade.php index bd250ae2c2..df25d807dc 100644 --- a/src/wp-admin/includes/upgrade.php +++ b/src/wp-admin/includes/upgrade.php @@ -1549,8 +1549,10 @@ function dbDelta( $queries = '', $execute = true ) { $global_tables = $wpdb->tables( 'global' ); foreach ( $cqueries as $table => $qry ) { // 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, $global_tables ) && ( !is_main_site() || defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) ) + if ( in_array( $table, $global_tables ) && ( !is_main_site() || defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) ) { + unset( $cqueries[ $table ], $for_update[ $table ] ); continue; + } // Fetch the table column structure from the database $suppress = $wpdb->suppress_errors();