mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 01:09:21 +02:00
Don't allow redirect to external website
This commit is contained in:
parent
1186f94e21
commit
c92a410209
@ -22,11 +22,5 @@ if(isset($account_logged) && $account_logged->isLoaded()) {
|
||||
|
||||
$logged = false;
|
||||
unset($account_logged);
|
||||
|
||||
if(isset($_REQUEST['redirect']))
|
||||
{
|
||||
header('Location: ' . urldecode($_REQUEST['redirect']));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
));
|
||||
|
Loading…
x
Reference in New Issue
Block a user