diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-06-06 14:58:05 +0200 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-06-06 14:58:05 +0200 |
commit | 47b673324f06236264ca64f8c3155aab51762609 (patch) | |
tree | f3754539c910f32e714dd41bcafdadf2cd4fcf3c /system | |
parent | 4c8bf738bb41bcda840105e3d6f767408989cc75 (diff) |
Add a second parameter (charset) to CI_Output::set_content_type() + fix for issue #666
Diffstat (limited to 'system')
-rwxr-xr-x | system/core/Output.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/system/core/Output.php b/system/core/Output.php index 09656711b..0bf982289 100755 --- a/system/core/Output.php +++ b/system/core/Output.php @@ -200,7 +200,7 @@ class CI_Output { * @param string extension of the file we're outputting * @return void */ - public function set_content_type($mime_type) + public function set_content_type($mime_type, $charset = NULL) { if (strpos($mime_type, '/') === FALSE) { @@ -218,7 +218,13 @@ class CI_Output { } } - $header = 'Content-Type: '.$mime_type; + if (empty($charset)) + { + $charset = config_item('charset'); + } + + $header = 'Content-Type: '.$mime_type + .(empty($charset) ? NULL : '; charset='.strtolower($charset)); $this->headers[] = array($header, TRUE); return $this; |