a little better query handling in redirect code

This commit is contained in:
Evan Prodromou 2009-06-15 16:51:49 -07:00
parent 2f82a3d44c
commit f809663245
1 changed files with 13 additions and 2 deletions

View File

@ -93,8 +93,19 @@ class Status_network extends DB_DataObject
function redirectToHostname()
{
$destination = 'http://'.$this->hostname;
$destination .= $_SERVER['REQUEST_URI'].
$_SERVER['QUERY_STRING'];
$destination .= $_SERVER['REQUEST_URI'];
$args = $_GET;
if (isset($args['p'])) {
unset($args['p']);
}
$query = http_build_query($args);
if (strlen($query) > 0) {
$destination .= '?' . $query;
}
$old = 'http'.
(($_SERVER['HTTPS'] == 'on') ? 'S' : '').