Add support for https behind a reverse proxy using X-Forwarded-Proto
diff --git a/system/core/Common.php b/system/core/Common.php
index cad340f..7bf11da 100644
--- a/system/core/Common.php
+++ b/system/core/Common.php
@@ -345,9 +345,17 @@
* @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 @@
}
/* End of file Common.php */
-/* Location: ./system/core/Common.php */
\ No newline at end of file
+/* Location: ./system/core/Common.php */