]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/util.php
Don't always make spam_score writeable
[quix0rs-gnu-social.git] / lib / util.php
index 99be56daeb3981a211abf683411975cf0a36e00b..a061d17739356cc0bc9643a39bec2106513b7efb 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_key_exists('HTTP_HOST', $_SERVER)) ? $_SERVER['HTTP_HOST'] : null;
 
         // Are we pointing to another server (like an SSL server?)