summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2013-06-24 15:24:34 +0200
committerAndrey Andreev <narf@devilix.net>2013-06-24 15:24:34 +0200
commitbb08afd4bcd54b1b5c799ca3db2bbb66c5567801 (patch)
tree7211fb2e7f3493a1a9160fc55c852408d865bef9 /system
parenta2bbb045f262e49e8f3143e17c8466885b3967f9 (diff)
parent98999976f6025d7ffcb04f8aa448518651fb0d89 (diff)
Merge pull request #2488 from Xeli/develop
Add support for https behind a reverse proxy using X-Forwarded-Proto
Diffstat (limited to 'system')
-rw-r--r--system/core/Common.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/system/core/Common.php b/system/core/Common.php
index cad340f33..cb087cb22 100644
--- a/system/core/Common.php
+++ b/system/core/Common.php
@@ -346,7 +346,20 @@ if ( ! function_exists('is_https'))
*/
function is_https()
{
- return (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) === 'on');
+ if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) === 'on')
+ {
+ return TRUE;
+ }
+ elseif (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https')
+ {
+ return TRUE;
+ }
+ elseif (isset($_SERVER['HTTP_FRONT_END_HTTPS']) && $_SERVER['HTTP_FRONT_END_HTTPS'] === 'on')
+ {
+ return TRUE;
+ }
+
+ return FALSE;
}
}