]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
fix #344 FQDN with non-standard ports broken
authorNicolas Lœuillet <nicolas@loeuillet.org>
Thu, 29 May 2014 16:32:55 +0000 (18:32 +0200)
committerNicolas Lœuillet <nicolas@loeuillet.org>
Thu, 29 May 2014 16:32:55 +0000 (18:32 +0200)
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;