summaryrefslogtreecommitdiffstats
path: root/system/helpers/form_helper.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/helpers/form_helper.php')
-rw-r--r--system/helpers/form_helper.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php
index 758056b50..8aa788c6c 100644
--- 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.'"';