From 64b03439b517695f1bfd0aa15f0f9e872b27c029 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 24 Apr 2012 12:55:09 -0400 Subject: [PATCH] Check for HTTP_HOST before fetching it --- lib/util.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/util.php b/lib/util.php index 99be56daeb..3c65d287d0 100644 --- a/lib/util.php +++ b/lib/util.php @@ -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?) -- 2.39.5