Skip to content

Commit

Permalink
handle malformed uri
Browse files Browse the repository at this point in the history
  • Loading branch information
imorland committed Jan 5, 2024
1 parent 2aadc5c commit a1dd387
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion framework/core/src/Forum/Controller/LogOutController.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,11 @@ protected function sanitizeReturnUrl(string $url, string $base): Uri
return new Uri($base);
}

$parsedUrl = new Uri($url);
try {
$parsedUrl = new Uri($url);
} catch (\InvalidArgumentException $e) {
return new Uri($base);
}

if (in_array($parsedUrl->getHost(), $this->getWhitelistedRedirectDomains())) {
return $parsedUrl;
Expand Down

0 comments on commit a1dd387

Please sign in to comment.