Don't allow redirect to external website

This commit is contained in:
slawkens
2024-04-08 19:08:21 +02:00
parent 1186f94e21
commit c92a410209
2 changed files with 6 additions and 6 deletions

View File

@@ -12,6 +12,12 @@ defined('MYAAC') or die('Direct access not allowed!');
$redirect = urldecode($_REQUEST['redirect']);
// should never happen, unless hacker modify the URL
if (!str_contains($_REQUEST['redirect'], BASE_URL)) {
error('Fatal error: Cannot redirect outside the website.');
return;
}
$twig->display('account.redirect.html.twig', array(
'redirect' => $redirect
));