summaryrefslogtreecommitdiffstats
path: root/system/helpers
diff options
context:
space:
mode:
authorDerek Allard <derek.allard@ellislab.com>2009-09-16 10:20:58 +0200
committerDerek Allard <derek.allard@ellislab.com>2009-09-16 10:20:58 +0200
commit928158bf3a308330ab6518ff0d149d4585d7f38f (patch)
treea956e0e0075bee87a13fb55260d5aab51dd26e66 /system/helpers
parentbbedc76aaf59f6f12a7bc32e1aa851317a61c837 (diff)
adding accept-charset to form_open()
Diffstat (limited to 'system/helpers')
-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;