summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorCJ <chern.jie@mig33global.com>2013-04-16 19:04:13 +0200
committerCJ <chern.jie@mig33global.com>2013-04-16 19:04:13 +0200
commitd195f224db31644eaaef4b4cb4713d9af5f57ead (patch)
treea694e1f5b0b3a93bb8bca11e7e3ac68fe22d91a1 /system
parentd08e18cafb31af586002e4de39f12cf8e048383b (diff)
See #2409: Reformating and code cleanup for request_headers;
Diffstat (limited to 'system')
-rw-r--r--system/core/Input.php23
1 files changed, 8 insertions, 15 deletions
diff --git a/system/core/Input.php b/system/core/Input.php
index a0c5552f6..6b7d5bd43 100644
--- a/system/core/Input.php
+++ b/system/core/Input.php
@@ -801,25 +801,18 @@ class CI_Input {
{
return $this->headers = apache_request_headers();
}
- else
- {
- $headers['CONTENT_TYPE'] = isset($_SERVER['CONTENT_TYPE']) ? $_SERVER['CONTENT_TYPE'] : @getenv('CONTENT_TYPE');
- foreach ($_SERVER as $key => $val)
- {
- if (sscanf($key, 'HTTP_%s', $header) === 1)
- {
- $headers[$header] = $this->_fetch_from_array($_SERVER, $key, $xss_clean);
- }
- }
+ $this->headers['CONTENT_TYPE'] = isset($_SERVER['CONTENT_TYPE']) ? $_SERVER['CONTENT_TYPE'] : @getenv('CONTENT_TYPE');
- // take SOME_HEADER and turn it into Some-Header
- foreach ($headers as $key => $val)
+ foreach ($_SERVER as $key => $val)
+ {
+ if (sscanf($key, 'HTTP_%s', $header) === 1)
{
- $key = str_replace('_', ' ', strtolower($key));
- $key = str_replace(' ', '-', ucwords($key));
+ // take SOME_HEADER and turn it into Some-Header
+ $header = str_replace('_', ' ', strtolower($header));
+ $header = str_replace(' ', '-', ucwords($header));
- $this->headers[$key] = $val;
+ $this->headers[$header] = $this->_fetch_from_array($_SERVER, $key, $xss_clean);
}
}