]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
[fix] with some config, http host is different 614/head
authorNicolas Lœuillet <nicolas@loeuillet.org>
Mon, 7 Apr 2014 13:44:05 +0000 (15:44 +0200)
committerNicolas Lœuillet <nicolas@loeuillet.org>
Mon, 7 Apr 2014 13:44:05 +0000 (15:44 +0200)
inc/poche/Tools.class.php

index a130e94b6eaa51a89e2460f25fea1a7cd54ca192..7f06402079408ebfbc36ead8d6607cef21b99134 100755 (executable)
@@ -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 = '')