summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorCJ <chern.jie@mig33global.com>2013-04-16 15:50:55 +0200
committerCJ <chern.jie@mig33global.com>2013-04-16 15:50:55 +0200
commit71cff1da396ba0c56644c04fdd2729db6766c557 (patch)
tree539d87b902efe074fc01f460245beb22f340209b /system
parent826990fc88208103142385f1a448bb4771213155 (diff)
#2409: Updated based on feedback by @narfbg;
Diffstat (limited to 'system')
-rw-r--r--system/core/Input.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/system/core/Input.php b/system/core/Input.php
index 31bd7008b..7a6b6e4e0 100644
--- a/system/core/Input.php
+++ b/system/core/Input.php
@@ -790,10 +790,16 @@ class CI_Input {
*/
public function request_headers($xss_clean = FALSE)
{
+ // If header is already defined, return it immediately
+ if ( ! empty($this->headers))
+ {
+ return $this->headers;
+ }
+
// In Apache, you can simply call apache_request_headers()
if (function_exists('apache_request_headers'))
{
- $this->headers = apache_request_headers();
+ return $this->headers = apache_request_headers();
}
else
{
@@ -810,7 +816,7 @@ class CI_Input {
// take SOME_HEADER and turn it into Some-Header
foreach ($headers as $key => $val)
{
- $key = str_replace('_', ' ', strtolower($key));
+ $key = str_replace(array('_', '-'), ' ', strtolower($key));
$key = str_replace(' ', '-', ucwords($key));
$this->headers[$key] = $val;