Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Don't double absolute url
Signed-off-by: Carl Schwan <[email protected]>
  • Loading branch information
CarlSchwan committed Jan 25, 2022
commit b32c7e6926e2bb2ae0f1ed5bce7b4eda564e2685
7 changes: 6 additions & 1 deletion core/Controller/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,12 @@ private function canResetPassword(?string $passwordLink, ?IUser $user): bool {

private function generateRedirect(?string $redirectUrl): RedirectResponse {
if ($redirectUrl !== null && $this->userSession->isLoggedIn()) {
$location = $this->urlGenerator->getAbsoluteURL($redirectUrl);
$location = null;
if (str_starts_with($redirectUrl, 'http')) {
$location = $redirectUrl;
} else {
$location = $this->urlGenerator->getAbsoluteURL($redirectUrl);
}
// Deny the redirect if the URL contains a @
// This prevents unvalidated redirects like ?redirect_url=:[email protected]
if (strpos($location, '@') === false) {
Expand Down