summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-06-15 16:51:49 -0700
committerEvan Prodromou <evan@controlyourself.ca>2009-06-15 16:51:49 -0700
commitf80966324560d4309b3bb2d6d357719e1e90e6aa (patch)
tree4f1b90e573e8f0688da107aa8401794d591cc020
parent2f82a3d44c4fbb0d9c552a2652e341ec882787c1 (diff)
a little better query handling in redirect code
-rw-r--r--classes/Status_network.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/classes/Status_network.php b/classes/Status_network.php
index 128721f41..03e8f4525 100644
--- a/classes/Status_network.php
+++ b/classes/Status_network.php
@@ -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' : '').