From c4f9c62a604079fe3c2ab7637ffad894188fb429 Mon Sep 17 00:00:00 2001 From: vlakoff Date: Sat, 27 Jul 2013 10:08:00 +0200 Subject: More logical order --- system/helpers/form_helper.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'system/helpers/form_helper.php') 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 = '
\n"; // Add CSRF field if enabled, but leave it out for GET requests and requests to external websites -- cgit v1.2.3-24-g4f1b