From 5d676352c376fd5f69d5cfee491e6243a6e8c866 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 11 Jan 2010 15:09:46 -0800 Subject: [PATCH] strip out session ID from root URL --- lib/util.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/util.php b/lib/util.php index 1237d718bd..3e52f5db16 100644 --- a/lib/util.php +++ b/lib/util.php @@ -838,7 +838,7 @@ function common_path($relative, $ssl=false) } $relative = common_inject_session($relative, $serverpart); - + return $proto.'://'.$serverpart.'/'.$pathpart.$relative; } @@ -849,7 +849,7 @@ function common_inject_session($url, $serverpart = null) if (empty($serverpart)) { $serverpart = parse_url($url, PHP_URL_HOST); } - + $currentServer = $_SERVER['HTTP_HOST']; // Are we pointing to another server (like an SSL server?) @@ -866,7 +866,7 @@ function common_inject_session($url, $serverpart = null) } } } - + return $url; } @@ -1057,7 +1057,12 @@ function common_profile_url($nickname) function common_root_url($ssl=false) { - return common_path('', $ssl); + $url = common_path('', $ssl); + $i = strpos($url, '?'); + if ($i !== false) { + $url = substr($url, 0, $i); + } + return $url; } // returns $bytes bytes of random data as a hexadecimal string -- 2.39.5