summaryrefslogtreecommitdiffstats
path: root/system/core
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2016-12-01 12:48:58 +0100
committerAndrey Andreev <narf@devilix.net>2016-12-01 12:48:58 +0100
commite377910ccf826b448203513bf63bd5721bbd1375 (patch)
treee89a3e511563bb19e1afdc633ce29fd0cd959236 /system/core
parent6276926c6dcdf976a5f4de34d62f501852e2f84b (diff)
Fix #4927
Diffstat (limited to 'system/core')
-rw-r--r--system/core/Output.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/system/core/Output.php b/system/core/Output.php
index cf6510ff1..57c78ab19 100644
--- a/system/core/Output.php
+++ b/system/core/Output.php
@@ -311,11 +311,12 @@ class CI_Output {
return NULL;
}
- for ($i = 0, $c = count($headers); $i < $c; $i++)
+ // Count backwards, in order to get the last matching header
+ for ($c = count($headers) - 1; $c > -1; $c--)
{
- if (strncasecmp($header, $headers[$i], $l = self::strlen($header)) === 0)
+ if (strncasecmp($header, $headers[$c], $l = self::strlen($header)) === 0)
{
- return trim(self::substr($headers[$i], $l+1));
+ return trim(self::substr($headers[$c], $l+1));
}
}