fix router
This commit is contained in:
parent
180eaef3db
commit
6ae7c7369b
1 changed files with 8 additions and 3 deletions
|
@ -91,7 +91,10 @@ class Router {
|
||||||
if (is_array($redirect)) {
|
if (is_array($redirect)) {
|
||||||
$redirect = $redirect['redirect'];
|
$redirect = $redirect['redirect'];
|
||||||
}
|
}
|
||||||
$redirect = maybe_base64_decode($redirect);
|
if ($redirect == $this->domain)
|
||||||
|
$redirect = '';
|
||||||
|
if ($redirect != '')
|
||||||
|
$redirect = maybe_base64_decode($redirect);
|
||||||
return $redirect;
|
return $redirect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,7 +139,7 @@ class Router {
|
||||||
}
|
}
|
||||||
http_response_code(303);
|
http_response_code(303);
|
||||||
$session->write_headers();
|
$session->write_headers();
|
||||||
header("Location: $redirect");
|
header("Location: {$redirect}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,7 +167,9 @@ class Router {
|
||||||
// redirect them to login
|
// redirect them to login
|
||||||
http_response_code(303);
|
http_response_code(303);
|
||||||
$redirect = maybe_base64_encode($this->get_redirect());
|
$redirect = maybe_base64_encode($this->get_redirect());
|
||||||
header("Location: http://{$this->domain}/login?redirect={$redirect}");
|
if ($redirect != '')
|
||||||
|
$redirect = "?redirect={$redirect}";
|
||||||
|
header("Location: http://{$this->domain}/login{$redirect}");
|
||||||
} else {
|
} else {
|
||||||
// update session expiry
|
// update session expiry
|
||||||
$session->reset_expiry();
|
$session->reset_expiry();
|
||||||
|
|
Loading…
Reference in a new issue