WordPress.org

Make WordPress Core

Changeset 18522


Ignore:
Timestamp:
08/10/2011 07:00:45 PM (8 years ago)
Author:
nacin
Message:

Don't process wpdb->tables('global') inside a loop. props wpmuguru, fixes #14503.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/upgrade.php

    r16959 r18522  
    14071407    if ($tables = $wpdb->get_col('SHOW TABLES;')) {
    14081408        // For every table in the database
     1409        $global_tables = $wpdb->tables( 'global' );
    14091410        foreach ($tables as $table) {
    14101411            // Upgrade global tables only for the main site. Don't upgrade at all if DO_NOT_UPGRADE_GLOBAL_TABLES is defined.
    1411             if ( in_array($table, $wpdb->tables('global')) && ( !is_main_site() || defined('DO_NOT_UPGRADE_GLOBAL_TABLES') ) )
     1412            if ( in_array( $table, $global_tables ) && ( !is_main_site() || defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) )
    14121413                continue;
    14131414
Note: See TracChangeset for help on using the changeset viewer.