From 69c57493e758ec71380fb04accc223bd169be51c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 7 Apr 2014 15:44:05 +0200 Subject: [PATCH] [fix] with some config, http host is different --- inc/poche/Tools.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index a130e94..7f06402 100755 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php @@ -59,8 +59,10 @@ class Tools return $scriptname; } + $host = (isset($_SERVER['HTTP_X_FORWARDED_HOST']) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME'])); + return 'http' . ($https ? 's' : '') . '://' - . $_SERVER["HTTP_HOST"] . $serverport . $scriptname; + . $host . $serverport . $scriptname; } public static function redirect($url = '')