In wpdb::db_connect(), allow the loading of a custom database error template - this is already allowed in dead_db().

In `dead_db()`, move the call to `wp_load_translations_early()` before the inclusion of the `db-error.php` file to allow translation in both locations before the template is loaded.

Props sbruner, kovshenin.
Fixes #25703.



git-svn-id: https://develop.svn.wordpress.org/trunk@27056 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2014-01-29 05:27:24 +00:00
parent 99ef83d7aa
commit 62b57d8899
2 changed files with 9 additions and 2 deletions
+7
View File
@@ -1154,6 +1154,13 @@ class wpdb {
if ( !$this->dbh ) {
wp_load_translations_early();
// Load custom DB error template, if present.
if ( file_exists( WP_CONTENT_DIR . '/db-error.php' ) ) {
require_once( WP_CONTENT_DIR . '/db-error.php' );
die();
}
$this->bail( sprintf( __( "
<h1>Error establishing a database connection</h1>
<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>