]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Merge pull request #836 from akoenig/x-forwarded-port
authorNicolas Lœuillet <nicolas@loeuillet.org>
Tue, 16 Sep 2014 18:09:58 +0000 (20:09 +0200)
committerNicolas Lœuillet <nicolas@loeuillet.org>
Tue, 16 Sep 2014 18:09:58 +0000 (20:09 +0200)
Implemented additional check for using the 'X-Forwarded-Port' header.

inc/poche/Tools.class.php

index 55fedac8df38fad0c87b6e3e8bf4029f0a6811f9..93ec3fc6a877bf93f00e7c0dfadfd2cdf2b412d8 100755 (executable)
@@ -54,6 +54,10 @@ final class Tools
             || ($https && $_SERVER["SERVER_PORT"] == '443')
             || ($https && $_SERVER["SERVER_PORT"]==SSL_PORT) //Custom HTTPS port detection
             ? '' : ':' . $_SERVER["SERVER_PORT"]);
+        
+        if (isset($_SERVER["HTTP_X_FORWARDED_PORT"])) {
+            $serverport = ':' . $_SERVER["HTTP_X_FORWARDED_PORT"];
+        }
 
         $scriptname = str_replace('/index.php', '/', $_SERVER["SCRIPT_NAME"]);