From f0c7b665769f37b6aa97019e517f4e8d041f5046 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Sat, 11 Apr 2015 11:19:53 +1000 Subject: [PATCH] Adds minor safeguard to #1044 ^- For objects that can be cast as strings and do not interface Symfony's Response --- modules/system/classes/ErrorHandler.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/system/classes/ErrorHandler.php b/modules/system/classes/ErrorHandler.php index 43af29373..bbe26204c 100644 --- a/modules/system/classes/ErrorHandler.php +++ b/modules/system/classes/ErrorHandler.php @@ -49,7 +49,14 @@ class ErrorHandler extends ErrorHandlerBase // Route to the CMS error page. $controller = new Controller($theme); - return $controller->run('/error')->getContent(); + $result = $controller->run('/error'); + + // Extract content from response object + if ($result instanceof \Symfony\Component\HttpFoundation\Response) { + $result = $result->getContent(); + } + + return $result; } /**