mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-22 06:29:30 +00:00
Don't process wpdb->tables('global') inside a loop. props wpmuguru, fixes #14503.
git-svn-id: http://svn.automattic.com/wordpress/trunk@18522 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c3c4ced486
commit
45f2e1a527
@ -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...
|
||||
|
Loading…
x
Reference in New Issue
Block a user