ENHANCEMENT In Debug::showError(), if error is displayed through ajax with CliDebugView, use plaintext output

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@62468 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2008-09-16 18:15:26 +00:00
parent c57ce5f1a4
commit 0739b0520e

View File

@ -303,6 +303,9 @@ class Debug {
$errText = "$errtype: \"$errstr\" at line $errline of $errfile";
$errText = str_replace(array("\n","\r")," ",$errText);
header("HTTP/1.0 500 $errText");
// if error is displayed through ajax with CliDebugView, use plaintext output
if(Director::is_ajax()) header('Content-Type: text/plain');
}
// Legacy error handling for customized prototype.js Ajax.Base.responseIsSuccess()