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