From 04147caca881416016ebf81df78e6d8610c77244 Mon Sep 17 00:00:00 2001 From: mark_story Date: Sun, 3 Jul 2011 15:33:27 -0400 Subject: [PATCH] Updating ExceptionRenderer and CakeErrorHandler for Controller changes. --- lib/Cake/Controller/CakeErrorController.php | 4 ++-- lib/Cake/Error/ExceptionRenderer.php | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/Cake/Controller/CakeErrorController.php b/lib/Cake/Controller/CakeErrorController.php index f75ec24a7..fbb777ea0 100644 --- a/lib/Cake/Controller/CakeErrorController.php +++ b/lib/Cake/Controller/CakeErrorController.php @@ -22,8 +22,8 @@ class CakeErrorController extends AppController { * @access public * @return void */ - public function __construct($request = null) { - parent::__construct($request); + public function __construct($request = null, $response = null) { + parent::__construct($request, $response); $this->constructClasses(); $this->Components->trigger('initialize', array(&$this)); $this->_set(array('cacheAction' => false, 'viewPath' => 'Errors')); diff --git a/lib/Cake/Error/ExceptionRenderer.php b/lib/Cake/Error/ExceptionRenderer.php index 1cadfc35e..db5d87358 100644 --- a/lib/Cake/Error/ExceptionRenderer.php +++ b/lib/Cake/Error/ExceptionRenderer.php @@ -22,6 +22,7 @@ App::uses('Sanitize', 'Utility'); App::uses('Router', 'Routing'); +App::uses('CakeResponse', 'Network'); /** * Exception Renderer. @@ -148,10 +149,11 @@ class ExceptionRenderer { if (!$request = Router::getRequest(false)) { $request = new CakeRequest(); } + $response = new CakeResponse(array('charset' => Configure::read('App.encoding'))); try { - $controller = new CakeErrorController($request); + $controller = new CakeErrorController($request, $response); } catch (Exception $e) { - $controller = new Controller($request); + $controller = new Controller($request, $response); $controller->viewPath = 'Errors'; } return $controller;