Make WordPress Core

Ticket #19026: 19026.diff

File 19026.diff, 2.3 KB (added by ryan, 13 years ago)
  • wp-includes/functions.php

     
    18991899        if ( $installed )
    19001900                return true;
    19011901
     1902        // If visiting repair.php, return true and let it take over.
     1903        if ( defined( 'WP_REPAIRING' ) )
     1904                return true;
     1905
    19021906        $suppress = $wpdb->suppress_errors();
    1903         $tables = $wpdb->get_col('SHOW TABLES');
    1904         $wpdb->suppress_errors( $suppress );
    19051907
    1906         $wp_tables = $wpdb->tables();
    19071908        // Loop over the WP tables.  If none exist, then scratch install is allowed.
    19081909        // If one or more exist, suggest table repair since we got here because the options
    19091910        // table could not be accessed.
     1911        $wp_tables = $wpdb->tables();
    19101912        foreach ( $wp_tables as $table ) {
    1911                 // If one of the WP tables exist, then we are in an insane state.
    1912                 if ( in_array( $table, $tables ) ) {
    1913                         // The existence of custom user tables shouldn't suggest an insane state or prevent a clean install.
    1914                         if ( defined( 'CUSTOM_USER_TABLE' ) && CUSTOM_USER_TABLE == $table )
    1915                                 continue;
    1916                         if ( defined( 'CUSTOM_USER_META_TABLE' ) && CUSTOM_USER_META_TABLE == $table )
    1917                                 continue;
     1913                // The existence of custom user tables shouldn't suggest an insane state or prevent a clean install.
     1914                if ( defined( 'CUSTOM_USER_TABLE' ) && CUSTOM_USER_TABLE == $table )
     1915                        continue;
     1916                if ( defined( 'CUSTOM_USER_META_TABLE' ) && CUSTOM_USER_META_TABLE == $table )
     1917                        continue;
    19181918
    1919                         // If visiting repair.php, return true and let it take over.
    1920                         if ( defined('WP_REPAIRING') )
    1921                                 return true;
    1922                         // Die with a DB error.
    1923                         $wpdb->error = sprintf( /*WP_I18N_NO_TABLES*/'One or more database tables are unavailable.  The database may need to be <a href="%s">repaired</a>.'/*/WP_I18N_NO_TABLES*/, 'maint/repair.php?referrer=is_blog_installed' );
    1924                         dead_db();
    1925                 }
     1919                if ( ! $wpdb->get_results( "DESCRIBE $table;" ) )
     1920                        continue;
     1921
     1922                // One or more tables exist. We are insane.
     1923
     1924                // Die with a DB error.
     1925                $wpdb->error = sprintf( /*WP_I18N_NO_TABLES*/'One or more database tables are unavailable.  The database may need to be <a href="%s">repaired</a>.'/*/WP_I18N_NO_TABLES*/, 'maint/repair.php?referrer=is_blog_installed' );
     1926                dead_db();
    19261927        }
    19271928
     1929        $wpdb->suppress_errors( $suppress );
     1930
    19281931        wp_cache_set( 'is_blog_installed', false );
    19291932
    19301933        return false;