Skip to content
This repository
Browse code

FIX: exclude error string in headers to prevent white screen display.

  • Loading branch information...
commit 48408d323a75a9120f8b5d615268bf439a028651 1 parent 05cbb36
Will Rossiter authored June 29, 2012

Showing 1 changed file with 5 additions and 2 deletions. Show diff stats Hide diff stats

  1. 7  dev/Debug.php
7  dev/Debug.php
@@ -380,12 +380,15 @@ static function create_debug_view() {
380 380
 	 */
381 381
 	static function showError($errno, $errstr, $errfile, $errline, $errcontext, $errtype) {
382 382
 		if(!headers_sent()) {
383  
-			$errText = "$errtype: \"$errstr\" at line $errline of $errfile";
  383
+			$errText = "$errtype at line $errline of $errfile";
384 384
 			$errText = str_replace(array("\n","\r")," ",$errText);
  385
+
385 386
 			if(!headers_sent()) header($_SERVER['SERVER_PROTOCOL'] . " 500 $errText");
386 387
 			
387 388
 			// if error is displayed through ajax with CliDebugView, use plaintext output
388  
-			if(Director::is_ajax()) header('Content-Type: text/plain');
  389
+			if(Director::is_ajax()) {
  390
+				header('Content-Type: text/plain');
  391
+			} 
389 392
 		}
390 393
 		
391 394
 		// Legacy error handling for customized prototype.js Ajax.Base.responseIsSuccess()

0 notes on commit 48408d3

Please sign in to comment.
Something went wrong with that request. Please try again.