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:
parent
0c3db64585
commit
79024eb004
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user