summaryrefslogtreecommitdiffstats
path: root/system/core
diff options
context:
space:
mode:
authorJamie Rumbelow <jamie@jamierumbelow.net>2012-03-08 13:53:36 +0100
committerJamie Rumbelow <jamie@jamierumbelow.net>2012-03-08 13:53:36 +0100
commite311a99e127de3c9b86824127683c85cec2248b7 (patch)
treedeb8e1ac3a207de360801a96bc2a0f5436824c0a /system/core
parent0cd8c798de4b99b5ad41bacdeef77a4a7b815a03 (diff)
parent5d27c43d29fc049497010ea62ac7877a64bfed92 (diff)
Merge branch 'develop' of git://github.com/EllisLab/CodeIgniter into develop
Diffstat (limited to 'system/core')
-rwxr-xr-xsystem/core/Input.php17
-rwxr-xr-xsystem/core/Security.php4
2 files changed, 19 insertions, 2 deletions
diff --git a/system/core/Input.php b/system/core/Input.php
index ee15f4013..5a4659a5a 100755
--- a/system/core/Input.php
+++ b/system/core/Input.php
@@ -699,6 +699,23 @@ class CI_Input {
return (php_sapi_name() === 'cli' OR defined('STDIN'));
}
+ // --------------------------------------------------------------------
+
+ /**
+ * Get Request Method
+ *
+ * Return the Request Method
+ *
+ * @param bool uppercase or lowercase
+ * @return bool
+ */
+ public function method($upper = FALSE)
+ {
+ return ($upper)
+ ? strtoupper($this->server('REQUEST_METHOD'))
+ : strtolower($this->server('REQUEST_METHOD'));
+ }
+
}
/* End of file Input.php */
diff --git a/system/core/Security.php b/system/core/Security.php
index 6f25fb5bb..2bffa41b7 100755
--- a/system/core/Security.php
+++ b/system/core/Security.php
@@ -138,8 +138,8 @@ class CI_Security {
*/
public function csrf_verify()
{
- // If no POST data exists we will set the CSRF cookie
- if (count($_POST) === 0)
+ // If it's not a POST request we will set the CSRF cookie
+ if (strtoupper($_SERVER['REQUEST_METHOD']) !== 'POST')
{
return $this->csrf_set_cookie();
}