mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX: exclude error string in headers to prevent white screen display.
This commit is contained in:
parent
05cbb36ab5
commit
48408d323a
@ -380,12 +380,15 @@ class Debug {
|
||||
*/
|
||||
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()
|
||||
|
Loading…
Reference in New Issue
Block a user