From aeb4aa9565dfcd251f527362518e5c8be1df7e02 Mon Sep 17 00:00:00 2001 From: Daniel Hensby Date: Mon, 28 Mar 2016 01:20:18 +0100 Subject: [PATCH] FIX Dont allow plain text friendly errors --- dev/Debug.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/Debug.php b/dev/Debug.php index 3c7480775..b56688cd3 100644 --- a/dev/Debug.php +++ b/dev/Debug.php @@ -340,6 +340,7 @@ class Debug { if(Director::is_ajax()) { echo $friendlyErrorMessage; } else { + if(!headers_sent()) header('Content-Type: text/html'); if(class_exists('ErrorPage')){ $errorFilePath = ErrorPage::get_filepath_for_errorcode( $statusCode, @@ -347,7 +348,6 @@ class Debug { ); if(file_exists($errorFilePath)) { $content = file_get_contents($errorFilePath); - if(!headers_sent()) header('Content-Type: text/html'); // $BaseURL is left dynamic in error-###.html, so that multi-domain sites don't get broken echo str_replace('$BaseURL', Director::absoluteBaseURL(), $content); }