From 48408d323a75a9120f8b5d615268bf439a028651 Mon Sep 17 00:00:00 2001 From: Will Rossiter Date: Fri, 29 Jun 2012 18:14:14 +1200 Subject: [PATCH] FIX: exclude error string in headers to prevent white screen display. --- dev/Debug.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dev/Debug.php b/dev/Debug.php index e9a39ab387b..194a0d90bd8 100644 --- a/dev/Debug.php +++ b/dev/Debug.php @@ -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()