Make WordPress Core


Ignore:
Timestamp:
09/13/2007 06:23:23 AM (17 years ago)
Author:
markjaquith
Message:

Use wp_die() for WPDB bails. Send 500 response and no-cache headers so wp_die()s are not cached. props DD32. fixes #3471

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/wp-db.php

    r6046 r6110  
    402402        if ( !$this->show_errors )
    403403            return false;
    404 
    405         header('Content-Type: text/html; charset=utf-8');
    406 
    407         if (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false)
    408             $admin_dir = '';
    409         else
    410             $admin_dir = 'wp-admin/';
    411 
    412 ?>
    413 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    414 <html xmlns="http://www.w3.org/1999/xhtml">
    415 <head>
    416     <title>WordPress &rsaquo; Error</title>
    417     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    418     <link rel="stylesheet" href="<?php echo $admin_dir; ?>install.css" type="text/css" />
    419 </head>
    420 <body>
    421     <h1 id="logo"><img alt="WordPress" src="<?php echo $admin_dir; ?>images/wordpress-logo.png" /></h1>
    422     <p><?php echo $message; ?></p>
    423 </body>
    424 </html>
    425 <?php
    426         die();
     404        wp_die($message);
    427405    }
    428406}
Note: See TracChangeset for help on using the changeset viewer.