summaryrefslogtreecommitdiff
path: root/inc/init.php
diff options
context:
space:
mode:
authorGerrit Uitslag <klapinklapin@gmail.com>2014-09-28 13:46:04 +0200
committerGerrit Uitslag <klapinklapin@gmail.com>2014-09-28 13:46:04 +0200
commitb79379f2e598abaa2febb299cdfcebe0a95d034c (patch)
tree7098c3a758f606394f4b38d679b5198f8973cffe /inc/init.php
parent73411587cb6d2c54aefebe90c87799c4aa1d31ec (diff)
parentda9572711f54d13ce3c5506971154b0bc359723f (diff)
downloadrpg-b79379f2e598abaa2febb299cdfcebe0a95d034c.tar.gz
rpg-b79379f2e598abaa2febb299cdfcebe0a95d034c.tar.bz2
Merge remote-tracking branch 'origin/master' into overridablelangstrings
Conflicts: inc/plugin.php
Diffstat (limited to 'inc/init.php')
-rw-r--r--inc/init.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/inc/init.php b/inc/init.php
index be81ec844..24920a17d 100644
--- a/inc/init.php
+++ b/inc/init.php
@@ -472,10 +472,6 @@ function getBaseURL($abs=null){
$port = '';
}
- if(!$port && isset($_SERVER['SERVER_PORT'])) {
- $port = $_SERVER['SERVER_PORT'];
- }
-
if(is_null($port)){
$port = '';
}
@@ -506,6 +502,14 @@ function getBaseURL($abs=null){
* @returns bool true when SSL is active
*/
function is_ssl(){
+ // check if we are behind a reverse proxy
+ if (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) {
+ if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
+ return true;
+ } else {
+ return false;
+ }
+ }
if (!isset($_SERVER['HTTPS']) ||
preg_match('/^(|off|false|disabled)$/i',$_SERVER['HTTPS'])){
return false;