fix #344 FQDN with non-standard ports broken

This commit is contained in:
Nicolas Lœuillet 2014-05-29 18:32:55 +02:00
parent 0c3db64585
commit 79024eb004
1 changed files with 4 additions and 0 deletions

View File

@ -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;