diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-04-02 13:01:16 +0000 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-04-02 13:01:16 +0000 |
commit | 160b54760f9373c8c092114e3ca2410af0730ed2 (patch) | |
tree | 2c59728f422fddf31bd711473deecf2baadeb973 | |
parent | 96aa486060bda042cd8d4dc5e9a667f170a418d0 (diff) |
Fix the issue identified in
http://gallery.menalto.com/gallery_3.0_alpha_3_released?page=1#comment-304581
ticket #195
-rw-r--r-- | core/libraries/MY_View.php | 10 | ||||
-rw-r--r-- | core/libraries/Theme_View.php | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/core/libraries/MY_View.php b/core/libraries/MY_View.php index 26326b5d..9a44652c 100644 --- a/core/libraries/MY_View.php +++ b/core/libraries/MY_View.php @@ -19,6 +19,16 @@ */ class View extends View_Core { /** + * Override View_Core::__construct so that we can set the csrf value into all views. + * + * @see View_Core::__construct + */ + public function __construct($name = NULL, $data = NULL, $type = NULL) { + parent::__construct($name, $data, $type); + $this->set_global("csrf", access::csrf_token()); + } + + /** * Override View_Core::render so that we trap errors stemming from bad PHP includes and show a * visible stack trace to help developers. * diff --git a/core/libraries/Theme_View.php b/core/libraries/Theme_View.php index e28df958..6c280bf6 100644 --- a/core/libraries/Theme_View.php +++ b/core/libraries/Theme_View.php @@ -47,13 +47,11 @@ class Theme_View_Core extends View { $this->set_global("theme", $this); $this->set_global("user", user::active()); $this->set_global("page_type", $page_type); - $this->set_global("csrf", access::csrf_token()); $maintenance_mode = Kohana::config("core.maintenance_mode", false, false); if ($maintenance_mode) { message::warning(t("This site is currently in maintenance mode")); } - } public function url($path, $absolute_url=false) { |