From 612c52bb8b98506fc80e8c31ba0153e21a126f1f Mon Sep 17 00:00:00 2001 From: mark_story Date: Sun, 29 Aug 2010 23:31:20 -0400 Subject: [PATCH] Adding a beforeRender() that automatically escapes all the content sent to errors handled by CakeErrorController. --- cake/libs/controller/cake_error_controller.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cake/libs/controller/cake_error_controller.php b/cake/libs/controller/cake_error_controller.php index aafa76b6d3d..eb60e02b640 100644 --- a/cake/libs/controller/cake_error_controller.php +++ b/cake/libs/controller/cake_error_controller.php @@ -31,4 +31,15 @@ function __construct() { $this->Components->trigger('initialize', array(&$this)); $this->_set(array('cacheAction' => false, 'viewPath' => 'errors')); } + +/** + * Escapes the viewVars. + * + * @return void + */ + function beforeRender() { + foreach ($this->viewVars as $key => $value) { + $this->viewVars[$key] = h($value); + } + } } \ No newline at end of file