summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Tänzer <neo@nhng.de>2014-02-26 04:48:18 +0100
committerMichael Tänzer <neo@nhng.de>2014-02-26 04:48:18 +0100
commite96e2ab4e15e626410e830a866b409b08f6130b1 (patch)
tree12e6f64e73547ba3b545de7104215588764507a6
parent942f0c74831dfbe17fe0afa27e8c8e2f9134a5b1 (diff)
downloadcacert-devel-e96e2ab4e15e626410e830a866b409b08f6130b1.tar.gz
cacert-devel-e96e2ab4e15e626410e830a866b409b08f6130b1.tar.xz
cacert-devel-e96e2ab4e15e626410e830a866b409b08f6130b1.zip
bug 1192: Do not manually encode URIs, saves a lot of code and ugliness
(and probably little kittens). Also HTTP headers start with upper case letters Signed-off-by: Michael Tänzer <neo@nhng.de>
-rw-r--r--includes/loggedin.php37
1 files changed, 6 insertions, 31 deletions
diff --git a/includes/loggedin.php b/includes/loggedin.php
index 4054f5f..b386a2a 100644
--- a/includes/loggedin.php
+++ b/includes/loggedin.php
@@ -88,27 +88,15 @@
//session_unregister($key);
}
- $_SESSION['_config']['oldlocation'] = '';
-
- foreach($_GET as $key => $val)
- {
- if($_SESSION['_config']['oldlocation'])
- $_SESSION['_config']['oldlocation'] .= "&";
-
- $key = str_replace(array("\n", "\r"), '', $key);
- $val = str_replace(array("\n", "\r"), '', $val);
- $_SESSION['_config']['oldlocation'] .= "$key=$val";
- }
- $_SESSION['_config']['oldlocation'] = substr($_SERVER['SCRIPT_NAME'], 1)."?".$_SESSION['_config']['oldlocation'];
-
- header("location: https://".$_SESSION['_config']['securehostname']."/index.php?id=4");
+ $_SESSION['_config']['oldlocation'] = $_SERVER['REQUEST_URI'];
+ header("Location: https://{$_SESSION['_config']['securehostname']}/index.php?id=4");
exit;
}
}
if($_SERVER['HTTP_HOST'] == $_SESSION['_config']['securehostname'] && ($_SESSION['profile']['id'] <= 0 || $_SESSION['profile']['loggedin'] == 0))
{
- header("location: https://".$_SESSION['_config']['normalhostname']);
+ header("Location: https://{$_SESSION['_config']['normalhostname']}");
exit;
}
@@ -142,27 +130,14 @@
//session_unregister($key);
}
- header("location: https://".$normalhost."/index.php");
+ header("Location: https://{$normalhost}/index.php");
exit;
}
if($_SESSION['profile']['loggedin'] < 1)
{
- $_SESSION['_config']['oldlocation'] = '';
-
- foreach($_REQUEST as $key => $val)
- {
- if('' != $_SESSION['_config']['oldlocation'])
- $_SESSION['_config']['oldlocation'] .= "&";
-
- $key = str_replace(array("\n", "\r"), '', $key);
- $val = str_replace(array("\n", "\r"), '', $val);
- $_SESSION['_config']['oldlocation'] .= "$key=$val";
- }
- $_SESSION['_config']['oldlocation'] = substr($_SERVER['SCRIPT_NAME'], 1)."?".$_SESSION['_config']['oldlocation'];
- $hostname=$_SERVER['HTTP_HOST'];
- $hostname = str_replace(array("\n", "\r"), '', $hostname);
- header("location: https://".$hostname."/index.php?id=4");
+ $_SESSION['_config']['oldlocation'] = $_SERVER['REQUEST_URI'];
+ header("Location: https://{$_SERVER['HTTP_HOST']}/index.php?id=4");
exit;
}