summaryrefslogtreecommitdiffstats
path: root/system/helpers
diff options
context:
space:
mode:
authorGreg Aker <greg.aker@ellislab.com>2010-09-15 18:43:23 +0200
committerGreg Aker <greg.aker@ellislab.com>2010-09-15 18:43:23 +0200
commit28b425ad174e2c56fd523bf185ffb4e626009c02 (patch)
treea6208b15a50ca5e27e1a775341d7219e7d5db91b /system/helpers
parentfd2ba8836d74ded06cfe14f728387698c0532148 (diff)
Update to form_open() in form helper to drop hidden elements passed to the function into div class="hidden" (thanks Dan)
Diffstat (limited to 'system/helpers')
-rw-r--r--system/helpers/form_helper.php13
1 files changed, 5 insertions, 8 deletions
diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php
index fae5bde27..42355df42 100644
--- a/system/helpers/form_helper.php
+++ b/system/helpers/form_helper.php
@@ -57,18 +57,15 @@ if ( ! function_exists('form_open'))
$form .= '>';
- if (is_array($hidden) AND count($hidden) > 0)
+ // CSRF
+ if ($CI->config->item('csrf_protection') === TRUE)
{
- $form .= form_hidden($hidden);
+ $hidden[$CI->security->csrf_token_name] = $CI->security->csrf_hash;
}
- // CSRF
- if ($CI->config->item('csrf_protection') === TRUE)
+ if (is_array($hidden) AND count($hidden) > 0)
{
- $form .= sprintf('<div class="hidden">%s</div>',
- form_hidden($CI->security->csrf_token_name,
- $CI->security->csrf_hash)
- );
+ $form .= sprintf("\n<div class=\"hidden\">%s</div>", form_hidden($hidden));
}
return $form;