WordPress.org

Make WordPress Core

Ticket #6185: 6185.patch

File 6185.patch, 1.2 KB (added by pishmishy, 10 years ago)

Tidies up and documents terse error message

  • wp-includes/functions.php

     
    15741574        }
    15751575
    15761576        // If installing or in the admin, provide the verbose message.
    1577         if ( defined('WP_INSTALLING') || defined('WP_ADMIN') )
     1577        if ( defined('WP_INSTALLING') || defined('WP_ADMIN') ) {
    15781578                wp_die($wpdb->error);
    1579 
    1580         // Otherwise, be terse.
    1581         status_header( 500 );
    1582         nocache_headers();
    1583         header( 'Content-Type: text/html; charset=utf-8' );
    1584 ?>
    1585 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    1586 <html xmlns="http://www.w3.org/1999/xhtml" <?php if ( function_exists( 'language_attributes' ) ) language_attributes(); ?>>
    1587 <head>
    1588 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    1589         <title>Database Error</title>
    1590 
    1591 </head>
    1592 <body>
    1593         <h1>Error establishing a database connection</h1>
    1594 </body>
    1595 </html>
    1596 <?php
    1597         die();
     1579        } else {
     1580                // Provide a terse message. Avoids association of database problems with WordPress.
     1581                wp_die("Error establishing a database connection.","Database Error");
     1582        }       
    15981583}
    15991584
    16001585/**