Skip to content

Commit

Permalink
FIX: exclude error string in headers to prevent white screen display.
Browse files Browse the repository at this point in the history
  • Loading branch information
wilr committed Jun 29, 2012
1 parent 05cbb36 commit 48408d3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions dev/Debug.php
Expand Up @@ -380,12 +380,15 @@ static function create_debug_view() {
*/
static function showError($errno, $errstr, $errfile, $errline, $errcontext, $errtype) {
if(!headers_sent()) {
$errText = "$errtype: \"$errstr\" at line $errline of $errfile";
$errText = "$errtype at line $errline of $errfile";
$errText = str_replace(array("\n","\r")," ",$errText);

if(!headers_sent()) header($_SERVER['SERVER_PROTOCOL'] . " 500 $errText");

// if error is displayed through ajax with CliDebugView, use plaintext output
if(Director::is_ajax()) header('Content-Type: text/plain');
if(Director::is_ajax()) {
header('Content-Type: text/plain');
}
}

// Legacy error handling for customized prototype.js Ajax.Base.responseIsSuccess()
Expand Down

0 comments on commit 48408d3

Please sign in to comment.