diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2014-05-29 18:32:55 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2014-05-29 18:32:55 +0200 |
commit | 79024eb004bfb9de77ec60d648315888e70033ad (patch) | |
tree | ecd936e23c1c2637d91564ef9dcb21bf956715a9 /inc/poche | |
parent | 0c3db64585a605375147a4209938f9e028b79089 (diff) | |
download | wallabag-79024eb004bfb9de77ec60d648315888e70033ad.tar.gz wallabag-79024eb004bfb9de77ec60d648315888e70033ad.tar.zst wallabag-79024eb004bfb9de77ec60d648315888e70033ad.zip |
fix #344 FQDN with non-standard ports broken
Diffstat (limited to 'inc/poche')
-rwxr-xr-x | inc/poche/Tools.class.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index 7f064020..8073a3fe 100755 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php | |||
@@ -60,6 +60,10 @@ class Tools | |||
60 | } | 60 | } |
61 | 61 | ||
62 | $host = (isset($_SERVER['HTTP_X_FORWARDED_HOST']) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME'])); | 62 | $host = (isset($_SERVER['HTTP_X_FORWARDED_HOST']) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME'])); |
63 | |||
64 | if (strpos($host, ':') !== false) { | ||
65 | $serverport = ''; | ||
66 | } | ||
63 | 67 | ||
64 | return 'http' . ($https ? 's' : '') . '://' | 68 | return 'http' . ($https ? 's' : '') . '://' |
65 | . $host . $serverport . $scriptname; | 69 | . $host . $serverport . $scriptname; |