1
0
mirror of https://github.com/moparisthebest/wallabag synced 2024-11-23 17:42:15 -05:00

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

View File

@ -61,6 +61,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'])); $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' : '') . '://' return 'http' . ($https ? 's' : '') . '://'
. $host . $serverport . $scriptname; . $host . $serverport . $scriptname;
} }