WordPress.org

Make WordPress Core

Ticket #14397: 14397.diff

File 14397.diff, 603 bytes (added by wpmuguru, 5 years ago)

check for just this blog's tables

  • wp-includes/functions.php

     
    18321832                return true; 
    18331833 
    18341834        $suppress = $wpdb->suppress_errors(); 
    1835         $tables = $wpdb->get_col('SHOW TABLES'); 
     1835        $blog_prefix = $wpdb->get_blog_prefix(); 
     1836        if ( substr( $blog_prefix, -1 ) == '_' ) 
     1837                $blog_prefix =  substr( $blog_prefix, 0, -1 ) . '\_'; 
     1838 
     1839        $tables = $wpdb->get_col( "SHOW TABLES LIKE '{$blog_prefix}%'" ); 
    18361840        $wpdb->suppress_errors( $suppress ); 
    18371841 
    18381842        $wp_tables = $wpdb->tables();