]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Added support for custom ssl port
authorJean-Christophe Saad-Dupuy <saad.dupuy@gmail.com>
Mon, 7 Oct 2013 10:30:40 +0000 (12:30 +0200)
committerJean-Christophe Saad-Dupuy <saad.dupuy@gmail.com>
Mon, 7 Oct 2013 10:30:40 +0000 (12:30 +0200)
inc/poche/Tools.class.php

index 8eb988f46223c08cff1645fe80030f6b935a1640..6f2bc6e7208d2f678e272a19735d0718d5961e5b 100644 (file)
@@ -41,10 +41,14 @@ class Tools
         $https = (!empty($_SERVER['HTTPS'])
                     && (strtolower($_SERVER['HTTPS']) == 'on'))
             || (isset($_SERVER["SERVER_PORT"])
-                    && $_SERVER["SERVER_PORT"] == '443'); // HTTPS detection.
+                    && $_SERVER["SERVER_PORT"] == '443') // HTTPS detection.
+            || (isset($_SERVER["SERVER_PORT"]) && isset($SSL_PORT) //Custom HTTPS port detection 
+                    && $_SERVER["SERVER_PORT"] == $SSL_PORT);
+
         $serverport = (!isset($_SERVER["SERVER_PORT"])
             || $_SERVER["SERVER_PORT"] == '80'
             || ($https && $_SERVER["SERVER_PORT"] == '443')
+            || ($https && $_SERVER["SERVER_PORT"]==$SSL_PORT) //Custom HTTPS port detection
             ? '' : ':' . $_SERVER["SERVER_PORT"]);
 
         $scriptname = str_replace('/index.php', '/', $_SERVER["SCRIPT_NAME"]);
@@ -243,4 +247,4 @@ class Tools
         $lang = explode('.', $userlanguage);
         return str_replace('_', '-', $lang[0]);
     }
-}
\ No newline at end of file
+}