WordPress.org

Make WordPress Core

Changeset 27056


Ignore:
Timestamp:
01/29/2014 05:27:24 AM (8 years ago)
Author:
wonderboymusic
Message:

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.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r26926 r27056  
    27942794    global $wpdb;
    27952795
     2796    wp_load_translations_early();
     2797
    27962798    // Load custom DB error template, if present.
    27972799    if ( file_exists( WP_CONTENT_DIR . '/db-error.php' ) ) {
     
    28082810    nocache_headers();
    28092811    header( 'Content-Type: text/html; charset=utf-8' );
    2810 
    2811     wp_load_translations_early();
    28122812?>
    28132813<!DOCTYPE html>
  • trunk/src/wp-includes/wp-db.php

    r26512 r27056  
    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>
Note: See TracChangeset for help on using the changeset viewer.