diff -r 32a43ae3649b -r 645727469415 includes/dbal.php --- a/includes/dbal.php Sun Apr 19 18:35:35 2009 -0400 +++ b/includes/dbal.php Sun Apr 19 18:42:21 2009 -0400 @@ -83,10 +83,14 @@ } function _die($t = '') { - if(defined('ENANO_HEADERS_SENT')) { + if ( defined('ENANO_HEADERS_SENT') ) + { ob_clean(); } - header('HTTP/1.1 500 Internal Server Error'); + + if ( !headers_sent() ) + header('HTTP/1.1 500 Internal Server Error'); + $bt = $this->latest_query; // $this->sql_backtrace(); $e = htmlspecialchars(mysql_error()); if($e=='') $e='<none>'; @@ -99,6 +103,15 @@ Error returned by MySQL extension: ' . $e . '
Most recent SQL query:

'.$bt.'
'; + if ( defined('IN_ENANO_INSTALL') && is_object(@$GLOBALS['ui']) ) + { + global $ui; + echo '

Database error!

'; + echo $internal_text; + $ui->show_footer(); + + exit; + } if(defined('ENANO_CONFIG_FETCHED')) die_semicritical('Database error', $internal_text); else grinding_halt('Database error', $internal_text); exit;