summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
Diffstat (limited to 'system')
-rwxr-xr-xsystem/core/Output.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/system/core/Output.php b/system/core/Output.php
index 9bf818e88..09d74f0c0 100755
--- a/system/core/Output.php
+++ b/system/core/Output.php
@@ -220,6 +220,26 @@ 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
+ */
+ public function get_content_type()
+ {
+ foreach ($this->headers as $header)
+ {
+ if (preg_match('/^Content-Type/', $header[0]))
+ {
+ return str_replace('Content-Type: ', '', $header[0]);
+ }
+ }
+ return 'text/html';
+ }
// --------------------------------------------------------------------