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:
parent
99ef83d7aa
commit
62b57d8899
@ -2793,6 +2793,8 @@ function wp_ob_end_flush_all() {
|
||||
function dead_db() {
|
||||
global $wpdb;
|
||||
|
||||
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' );
|
||||
@ -2807,8 +2809,6 @@ function dead_db() {
|
||||
status_header( 500 );
|
||||
nocache_headers();
|
||||
header( 'Content-Type: text/html; charset=utf-8' );
|
||||
|
||||
wp_load_translations_early();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"<?php if ( is_rtl() ) echo ' dir="rtl"'; ?>>
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user