summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-04-03 11:30:50 +0200
committerAndrey Andreev <narf@bofh.bg>2012-04-03 11:30:50 +0200
commit00adf1d480f94692a625ec2165e0fcc9171c6e2f (patch)
tree8e45d70039bd5e918ee76d4512a3d6635deb39d7 /system
parent3178285527c11d6dbe6a9b03ea3cec162da031fb (diff)
Some improvements to the additions from pull #1234
Diffstat (limited to 'system')
-rwxr-xr-xsystem/core/Output.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/system/core/Output.php b/system/core/Output.php
index 09d74f0c0..01fd1d867 100755
--- a/system/core/Output.php
+++ b/system/core/Output.php
@@ -220,24 +220,24 @@ class CI_Output {
$this->headers[] = array($header, TRUE);
return $this;
}
-
+
// --------------------------------------------------------------------
-
+
/**
* Get Current Content Type Header
- * Return text/html if Content-Type is not set
*
- * @return string
+ * @return string 'text/html', if not already set
*/
public function get_content_type()
{
- foreach ($this->headers as $header)
+ for ($i = 0, $c = count($this->headers); $i < $c; $i++)
{
- if (preg_match('/^Content-Type/', $header[0]))
+ if (preg_match('/^Content-Type:\s(.+)$/', $this->headers[$i][0], $matches))
{
- return str_replace('Content-Type: ', '', $header[0]);
+ return $matches[1];
}
}
+
return 'text/html';
}