summaryrefslogtreecommitdiffstats
path: root/system/helpers/form_helper.php
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@server-speed.net>2011-04-10 10:39:31 +0200
committerFlorian Pritz <bluewind@server-speed.net>2011-04-10 10:39:31 +0200
commit1bdc9c8903eb2db33fdb8174d61e15100dfbbca8 (patch)
treeb0c645ad99e04f34817fc4e6385792111db42274 /system/helpers/form_helper.php
parent413d0cdac49257089a0790f6ac92973a36a6b69f (diff)
update to CI 2.0.2
Signed-off-by: Florian Pritz <bluewind@server-speed.net>
Diffstat (limited to 'system/helpers/form_helper.php')
-rwxr-xr-xsystem/helpers/form_helper.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php
index 758056b50..acd75c239 100755
--- a/system/helpers/form_helper.php
+++ b/system/helpers/form_helper.php
@@ -49,7 +49,14 @@ if ( ! function_exists('form_open'))
$attributes = 'method="post"';
}
- $action = ( strpos($action, '://') === FALSE) ? $CI->config->site_url($action) : $action;
+ // If an action is not a full URL then turn it into one
+ if ($action && strpos($action, '://') === FALSE)
+ {
+ $action = $CI->config->site_url($action);
+ }
+
+ // If no action is provided then set to the current url
+ $action OR $action = $CI->config->site_url($CI->uri->uri_string());
$form = '<form action="'.$action.'"';
@@ -60,7 +67,7 @@ if ( ! function_exists('form_open'))
// CSRF
if ($CI->config->item('csrf_protection') === TRUE)
{
- $hidden[$CI->security->csrf_token_name] = $CI->security->csrf_hash;
+ $hidden[$CI->security->get_csrf_token_name()] = $CI->security->get_csrf_hash();
}
if (is_array($hidden) AND count($hidden) > 0)