Make WordPress Core

Ticket #16990: 16990.patch

File 16990.patch, 773 bytes (added by noam@…, 10 years ago)

Include check for custom DB error template wp-content/db-error.php in db_connect(). This should allow db-error.php to work on Multisite.

  • wp-includes/wp-db.php

     
    11541154
    11551155                if ( !$this->dbh ) {
    11561156                        wp_load_translations_early();
     1157
     1158                        // Load custom DB error template, if present.
     1159                        if ( file_exists( WP_CONTENT_DIR . '/db-error.php' ) ) {
     1160                                require_once( WP_CONTENT_DIR . '/db-error.php' );
     1161                                die();
     1162                        }
     1163                       
    11571164                        $this->bail( sprintf( __( "
    11581165<h1>Error establishing a database connection</h1>
    11591166<p>This either means that the username and password information in your <code>wp-config.php</code> file is incorrect or we can't contact the database server at <code>%s</code>. This could mean your host's database server is down.</p>