Skip to content

Commit

Permalink
Adding a beforeRender() that automatically escapes all the content se…
Browse files Browse the repository at this point in the history
…nt to errors handled by CakeErrorController.
  • Loading branch information
markstory committed Aug 30, 2010
1 parent 78ac5bd commit 612c52b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cake/libs/controller/cake_error_controller.php
Expand Up @@ -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);
}
}
}

0 comments on commit 612c52b

Please sign in to comment.