diff options
-rw-r--r-- | system/helpers/form_helper.php | 13 |
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; |