From 928158bf3a308330ab6518ff0d149d4585d7f38f Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 16 Sep 2009 08:20:58 +0000 Subject: adding accept-charset to form_open() --- system/helpers/form_helper.php | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'system/helpers') diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index c5e977a40..2fd4807fc 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -44,9 +44,30 @@ if ( ! function_exists('form_open')) { $CI =& get_instance(); + $charset = strtolower($CI->config->item('charset')); + if ($attributes == '') { - $attributes = 'method="post"'; + $attributes = 'method="post" accept-charset="'.$charset.'"'; + } + else + { + if ( is_string($attributes) ) + { + if(strpos('accept-charset=') === FALSE) + { + $attributes .= ' accept-charset="'.$charset.'"'; + } + } + else + { + $attributes = (array) $attributes; + + if(!in_array('accept-charset', $attributes)) + { + $attributes['accept-charset'] = $charset; + } + } } $action = ( strpos($action, '://') === FALSE) ? $CI->config->site_url($action) : $action; -- cgit v1.2.3-24-g4f1b