diff options
author | root <root@ip-10-250-162-129.ec2.internal> | 2010-01-11 07:53:15 +0000 |
---|---|---|
committer | root <root@ip-10-250-162-129.ec2.internal> | 2010-01-11 07:53:15 +0000 |
commit | 6f9bdc5b8a23fcd140b1f16cfc8031d9a1748779 (patch) | |
tree | 5c8b714f7cd31857a3c6ba5868c9a6169b5bf14a /lib | |
parent | bed903d61c9631187b7c3c01f47ae0e6c197acb8 (diff) | |
parent | e0eb51e4bb51f17b0281b7ec4e3d4eca33240978 (diff) |
Merge branch 'sessionidparam' of http://git.gitorious.org/~evan/statusnet/evans-mainline into sessionidparam
Diffstat (limited to 'lib')
-rw-r--r-- | lib/util.php | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/lib/util.php b/lib/util.php index 50bd0e2ac..90d4a6532 100644 --- a/lib/util.php +++ b/lib/util.php @@ -809,14 +809,33 @@ function common_path($relative, $ssl=false) } else if (common_config('site', 'server')) { $serverpart = common_config('site', 'server'); } else { - common_log(LOG_ERR, 'Site Sever not configured, unable to determine site name.'); + common_log(LOG_ERR, 'Site server not configured, unable to determine site name.'); } } else { $proto = 'http'; if (common_config('site', 'server')) { $serverpart = common_config('site', 'server'); } else { - common_log(LOG_ERR, 'Site Sever not configured, unable to determine site name.'); + common_log(LOG_ERR, 'Site server not configured, unable to determine site name.'); + } + } + + if (common_have_session()) { + + $currentServer = $_SERVER['HTTP_HOST']; + + // Are we pointing to another server (like an SSL server?) + + if (!empty($currentServer) && + 0 != strcasecmp($currentServer, $serverpart)) { + // Pass the session ID as a GET parameter + $sesspart = session_name() . '=' . session_id(); + $i = strpos($relative, '?'); + if ($i === false) { // no GET params, just append + $relative .= '?' . $sesspart; + } else { + $relative = substr($relative, 0, $i + 1).$sesspart.'&'.substr($relative, $i + 1); + } } } |