Commit ea361fcc authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1774309: Only redirect with QUERY_STRING when it exists



If trying to access a page requiring login the system remembers the
path (QUERY_STRING) you were trying to access when login is successful

But if you login from the homepage there can be no QUERY_STRING set

Noticed when doing behat tests

behatnotneeded

Change-Id: I38cf1f6df7432d70ced5fe5df84bd56b47f1f163
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
(cherry picked from commit 1c3d039b)
parent 592728d8
......@@ -1645,7 +1645,7 @@ function login_submit(Pieform $form, $values) {
}
// Do redirect on login to avoid browser back button exploit
$requesturi = $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['QUERY_STRING'];
$requesturi = $_SERVER['SCRIPT_NAME'] . (!empty($_SERVER['QUERY_STRING']) ? '?' . $_SERVER['QUERY_STRING'] : '');
redirect($requesturi);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment