summaryrefslogtreecommitdiffstats
path: root/system/core/Output.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2016-12-01 13:14:18 +0100
committerAndrey Andreev <narf@devilix.net>2016-12-01 13:14:18 +0100
commit9e829e10e6f2d3786c358ca6c8c3ba2a149a6a40 (patch)
treec38faf49e7274c3edfdb5ebb59ce80ac35fe57d8 /system/core/Output.php
parentefd856edce0b952c8a7a62ec953ae1baee77ff34 (diff)
parent8db01f13809a92bac7bc95b02893175d7654d627 (diff)
Merge branch '3.1-stable' into develop
Diffstat (limited to 'system/core/Output.php')
-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 7921a54ef..94a6340e7 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));
}
}