summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorJoffrey Jaffeux <j.jaffeux@gmail.com>2012-06-06 16:59:04 +0200
committerJoffrey Jaffeux <j.jaffeux@gmail.com>2012-06-06 16:59:04 +0200
commitd284360a52691cd1f3a83ff51b498725146f81c7 (patch)
treec5ef6a1e9f9284d1447aef5090bb7a4b6b4054a1 /system
parent908f36a583384b0314d04c4cfe71992746e35daa (diff)
parent47b673324f06236264ca64f8c3155aab51762609 (diff)
Merge https://github.com/EllisLab/CodeIgniter into valid-ipv6
Conflicts: user_guide_src/source/changelog.rst
Diffstat (limited to 'system')
-rwxr-xr-xsystem/core/Output.php10
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;