]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Check for HTTP_HOST before fetching it
authorEvan Prodromou <evan@status.net>
Tue, 24 Apr 2012 16:55:09 +0000 (12:55 -0400)
committerEvan Prodromou <evan@status.net>
Tue, 24 Apr 2012 16:55:09 +0000 (12:55 -0400)
lib/util.php

index 99be56daeb3981a211abf683411975cf0a36e00b..3c65d287d018648b54ff1ee69bb1c9275a3a5c71 100644 (file)
@@ -1307,11 +1307,11 @@ function common_inject_session($url, $serverpart = null)
 {
     if (common_have_session()) {
 
-       if (empty($serverpart)) {
-           $serverpart = parse_url($url, PHP_URL_HOST);
-       }
+        if (empty($serverpart)) {
+            $serverpart = parse_url($url, PHP_URL_HOST);
+        }
 
-        $currentServer = $_SERVER['HTTP_HOST'];
+        $currentServer = (array_has_key('HTTP_HOST')) ? $_SERVER['HTTP_HOST'] : null;
 
         // Are we pointing to another server (like an SSL server?)