diff options
author | Richard Deurwaarder (Xeli) <richard@xelification.com> | 2013-06-19 10:57:27 +0200 |
---|---|---|
committer | Richard Deurwaarder (Xeli) <richard@xelification.com> | 2013-06-19 10:57:27 +0200 |
commit | 1074bbf1851499e98912349c386701657c7f2cdd (patch) | |
tree | 9fb8831a6d3883bb1289d21d8242ffb737667d19 /system | |
parent | 5b3be33299d41f9272c7c9e3f2d3a3161c1d11b4 (diff) |
Add support for https behind a reverse proxy using X-Forwarded-Proto
Diffstat (limited to 'system')
-rw-r--r-- | system/core/Common.php | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/system/core/Common.php b/system/core/Common.php index cad340f33..7bf11dae5 100644 --- a/system/core/Common.php +++ b/system/core/Common.php @@ -345,9 +345,17 @@ if ( ! function_exists('is_https')) * @return bool */ 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; + }else{ + return False + } + } } // ------------------------------------------------------------------------ @@ -731,4 +739,4 @@ if ( ! function_exists('function_usable')) } /* End of file Common.php */ -/* Location: ./system/core/Common.php */
\ No newline at end of file +/* Location: ./system/core/Common.php */ |