summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2016-09-27 19:34:33 +0200
committerFlorian Pritz <bluewind@xinu.at>2016-11-05 19:44:15 +0100
commit88109ab1093711137e1341ce16f769467f2395e0 (patch)
tree7ffb7d8946e43df16c7fc61f4d18512ad10c5c2e /application
parent8645083c2569995b6d12dbc2b11bbfa0848c2615 (diff)
c/MY_Controller: Extract CSRF protection code into method
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application')
-rw-r--r--application/core/MY_Controller.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/application/core/MY_Controller.php b/application/core/MY_Controller.php
index cbb95aa33..afd8b5ef2 100644
--- a/application/core/MY_Controller.php
+++ b/application/core/MY_Controller.php
@@ -62,11 +62,7 @@ class MY_Controller extends CI_Controller {
}
if ($csrf_protection && !$this->input->is_cli_request()) {
- // 2 functions for accessing config options, really?
- $this->config->set_item('csrf_protection', true);
- config_item("csrf_protection", true);
- $this->security->__construct();
- $this->security->csrf_verify();
+ $this->_setup_csrf_protection();
}
if ($this->config->item("environment") == "development") {
@@ -108,4 +104,12 @@ class MY_Controller extends CI_Controller {
}
}
+ private function _setup_csrf_protection()
+ {
+ // 2 functions for accessing config options, really?
+ $this->config->set_item('csrf_protection', true);
+ config_item("csrf_protection", true);
+ $this->security->__construct();
+ $this->security->csrf_verify();
+ }
}