summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
Diffstat (limited to 'system')
-rw-r--r--system/helpers/form_helper.php23
1 files changed, 22 insertions, 1 deletions
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;