From 79024eb004bfb9de77ec60d648315888e70033ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Thu, 29 May 2014 18:32:55 +0200 Subject: [PATCH] fix #344 FQDN with non-standard ports broken --- inc/poche/Tools.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index 7f06402..8073a3f 100755 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php @@ -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;