From 1074bbf1851499e98912349c386701657c7f2cdd Mon Sep 17 00:00:00 2001 From: "Richard Deurwaarder (Xeli)" Date: Wed, 19 Jun 2013 10:57:27 +0200 Subject: Add support for https behind a reverse proxy using X-Forwarded-Proto --- system/core/Common.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'system') 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 */ -- cgit v1.2.3-24-g4f1b