summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Sturgeon <email@philsturgeon.co.uk>2011-07-17 05:31:35 +0200
committerPhil Sturgeon <email@philsturgeon.co.uk>2011-07-17 05:31:35 +0200
commit3b840b60c5cc9041098f971c4c58889bc609d82a (patch)
tree55213175b4edc0cbb50be97ea92036b2aec7cbcb
parent1b1b67693060ecb6dd399ea6aee4a5503d96adda (diff)
parent866a23fd3ff7c1eab93ae015e37addc414aae2e4 (diff)
Merge branch 'develop' of github.com:philsturgeon/codeigniter-reactor into develop
-rw-r--r--system/helpers/form_helper.php4
-rw-r--r--user_guide/changelog.html1
2 files changed, 3 insertions, 2 deletions
diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php
index 2925d3c7c..5720a06ec 100644
--- a/system/helpers/form_helper.php
+++ b/system/helpers/form_helper.php
@@ -64,8 +64,8 @@ if ( ! function_exists('form_open'))
$form .= '>';
- // CSRF
- if ($CI->config->item('csrf_protection') === TRUE)
+ // Add CSRF field if enabled, but leave it out for GET requests and requests to external websites
+ if ($CI->config->item('csrf_protection') === TRUE AND ! (strpos($action, $CI->config->site_url()) === FALSE OR strpos($form, 'method="get"')))
{
$hidden[$CI->security->get_csrf_token_name()] = $CI->security->get_csrf_hash();
}
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index 8a6fea748..10e99cbce 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -81,6 +81,7 @@ Change Log
<li>Helpers
<ul>
<li>Added an optional third parameter to <samp>heading()</samp> which allows adding html attributes to the rendered heading tag.</li>
+ <li class="reactor"><kbd>form_open()</kbd> now only adds a hidden (Cross-site Reference Forgery) protection field when the form's action is internal and is set to the post method. (Reactor #165)</li>
</ul>
</li>
<li>Libraries