}
$relative = common_inject_session($relative, $serverpart);
-
+
return $proto.'://'.$serverpart.'/'.$pathpart.$relative;
}
if (empty($serverpart)) {
$serverpart = parse_url($url, PHP_URL_HOST);
}
-
+
$currentServer = $_SERVER['HTTP_HOST'];
// Are we pointing to another server (like an SSL server?)
}
}
}
-
+
return $url;
}
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