summaryrefslogtreecommitdiffstats
path: root/system/helpers/form_helper.php
diff options
context:
space:
mode:
authorvlakoff <vlakoff@gmail.com>2013-07-27 10:08:00 +0200
committervlakoff <vlakoff@gmail.com>2013-07-27 10:08:00 +0200
commitc4f9c62a604079fe3c2ab7637ffad894188fb429 (patch)
tree2677c0e26b51f8b78e9326b316cde51ac2dd8c07 /system/helpers/form_helper.php
parentea19bc4f8fea2a7b6d0b1d85c279369ec8fce06e (diff)
More logical order
Diffstat (limited to 'system/helpers/form_helper.php')
-rw-r--r--system/helpers/form_helper.php22
1 files changed, 11 insertions, 11 deletions
diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php
index f28296c2e..6fca73f85 100644
--- a/system/helpers/form_helper.php
+++ b/system/helpers/form_helper.php
@@ -54,6 +54,17 @@ if ( ! function_exists('form_open'))
{
$CI =& get_instance();
+ // If an action is not a full URL then turn it into one
+ if ($action && strpos($action, '://') === FALSE)
+ {
+ $action = $CI->config->site_url($action);
+ }
+ elseif ( ! $action)
+ {
+ // If no action is provided then set to the current url
+ $action = $CI->config->site_url($CI->uri->uri_string());
+ }
+
$attributes = _attributes_to_string($attributes);
if (stripos($attributes, 'method=') === FALSE)
@@ -66,17 +77,6 @@ if ( ! function_exists('form_open'))
$attributes .= ' accept-charset="'.strtolower(config_item('charset')).'"';
}
- // If an action is not a full URL then turn it into one
- if ($action && strpos($action, '://') === FALSE)
- {
- $action = $CI->config->site_url($action);
- }
- elseif ( ! $action)
- {
- // If no action is provided then set to the current url
- $action = $CI->config->site_url($CI->uri->uri_string());
- }
-
$form = '<form action="'.$action.'"'.$attributes.">\n";
// Add CSRF field if enabled, but leave it out for GET requests and requests to external websites