summaryrefslogtreecommitdiffstats
path: root/system/core/Security.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2016-12-14 17:41:52 +0100
committerAndrey Andreev <narf@devilix.net>2016-12-14 17:41:52 +0100
commit9f20c8011a80d74edb740081cd96388bb6a967e6 (patch)
tree281a63537895b7a92b15762815a0776310e67ab6 /system/core/Security.php
parentdcd6f5153b7e7e6d798d5a77af65b7460f152e5c (diff)
Move csrf_verify() call out of CI_Input
Diffstat (limited to 'system/core/Security.php')
-rw-r--r--system/core/Security.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/system/core/Security.php b/system/core/Security.php
index a80b52fd1..fb0ca3d4e 100644
--- a/system/core/Security.php
+++ b/system/core/Security.php
@@ -167,10 +167,12 @@ class CI_Security {
*
* @return void
*/
- public function __construct()
+ public function __construct($charset)
{
+ $this->charset = $charset;
+
// Is CSRF protection enabled?
- if (config_item('csrf_protection'))
+ if (config_item('csrf_protection') && ! is_cli())
{
// CSRF config
foreach (array('csrf_expire', 'csrf_token_name', 'csrf_cookie_name') as $key)
@@ -189,10 +191,9 @@ class CI_Security {
// Set the CSRF hash
$this->_csrf_set_hash();
+ $this->csrf_verify();
}
- $this->charset = strtoupper(config_item('charset'));
-
log_message('info', 'Security Class Initialized');
}