]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - inc/poche/Tools.class.php
fix #344 FQDN with non-standard ports broken
[github/wallabag/wallabag.git] / inc / poche / Tools.class.php
index 7f06402079408ebfbc36ead8d6607cef21b99134..8073a3fe88d77c28ead1fa6e7242933322d687fe 100755 (executable)
@@ -60,6 +60,10 @@ class Tools
         }
 
         $host = (isset($_SERVER['HTTP_X_FORWARDED_HOST']) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME']));
+
+        if (strpos($host, ':') !== false) {
+            $serverport = '';
+        }
         
         return 'http' . ($https ? 's' : '') . '://'
             . $host . $serverport . $scriptname;