Show
Ignore:
Timestamp:
12/21/07 02:57:21 (1 year ago)
Author:
ryan
Message:

Custom DB error page. fixes #5500 for 2.3

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/2.3/wp-includes/functions.php

    r6443 r6448  
    14201420} 
    14211421 
     1422function dead_db() { 
     1423    global $wpdb; 
     1424 
     1425    // Load custom DB error template, if present. 
     1426    if ( file_exists( ABSPATH . 'wp-content/db-error.php' ) ) { 
     1427        require_once( ABSPATH . 'wp-content/db-error.php' ); 
     1428        die(); 
     1429    } 
     1430 
     1431    // If installing or in the admin, provide the verbose message. 
     1432    if ( defined('WP_INSTALLING') || defined('WP_ADMIN') ) 
     1433        wp_die($wpdb->error); 
     1434 
     1435    // Otherwise, be terse. 
     1436    status_header( 500 ); 
     1437    nocache_headers(); 
     1438    header( 'Content-Type: text/html; charset=utf-8' ); 
    14221439?> 
     1440<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
     1441<html xmlns="http://www.w3.org/1999/xhtml" <?php if ( function_exists( 'language_attributes' ) ) language_attributes(); ?>> 
     1442<head> 
     1443    <title>Database Error</title> 
     1444    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
     1445</head> 
     1446<body> 
     1447    <h1>Error establishing a database connection</h1> 
     1448</body> 
     1449</html> 
     1450<?php 
     1451    die(); 
     1452} 
     1453 
     1454?>