mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Adding a beforeRender() that automatically escapes all the content sent to errors handled by CakeErrorController.
This commit is contained in:
parent
78ac5bd20f
commit
612c52bb8b
1 changed files with 11 additions and 0 deletions
|
@ -31,4 +31,15 @@ class CakeErrorController extends AppController {
|
||||||
$this->Components->trigger('initialize', array(&$this));
|
$this->Components->trigger('initialize', array(&$this));
|
||||||
$this->_set(array('cacheAction' => false, 'viewPath' => 'errors'));
|
$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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue