]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
fix #270 access from remote machine 299/head
authorDmitry Sandalov <dmitry@sandalov.org>
Tue, 5 Nov 2013 09:13:55 +0000 (12:13 +0300)
committerDmitry Sandalov <dmitry@sandalov.org>
Tue, 5 Nov 2013 09:13:55 +0000 (12:13 +0300)
Replacing SERVER_NAME with HTTP_HOST allows me to use Poche on remote machines

inc/poche/Tools.class.php

index 1d092823fd1cad93b6c342676656ae5abe36e111..030d75ba43869b3fd954f267b9da26bcc88a1fb7 100644 (file)
@@ -53,12 +53,12 @@ class Tools
 
         $scriptname = str_replace('/index.php', '/', $_SERVER["SCRIPT_NAME"]);
 
-        if (!isset($_SERVER["SERVER_NAME"])) {
+        if (!isset($_SERVER["HTTP_HOST"])) {
             return $scriptname;
         }
 
         return 'http' . ($https ? 's' : '') . '://'
-            . $_SERVER["SERVER_NAME"] . $serverport . $scriptname;
+            . $_SERVER["HTTP_HOST"] . $serverport . $scriptname;
     }
 
     public static function redirect($url = '')