Skip to content

Commit

Permalink
Post-fix redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
slawkens committed Apr 14, 2024
1 parent d225c2d commit eb0c2a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions system/pages/account/manage.php
Expand Up @@ -21,6 +21,12 @@
if(isset($_REQUEST['redirect']))
{
$redirect = urldecode($_REQUEST['redirect']);

// should never happen, unless hacker modify the URL
if (!str_contains($redirect, BASE_URL)) {
error('Fatal error: Cannot redirect outside the website.');
return;
}

$twig->display('account.redirect.html.twig', array(
'redirect' => $redirect
Expand Down
2 changes: 1 addition & 1 deletion system/pages/account/redirect.php
Expand Up @@ -13,7 +13,7 @@
$redirect = urldecode($_REQUEST['redirect']);

// should never happen, unless hacker modify the URL
if (!str_contains($_REQUEST['redirect'], BASE_URL)) {
if (!str_contains($redirect, BASE_URL)) {
error('Fatal error: Cannot redirect outside the website.');
return;
}
Expand Down

0 comments on commit eb0c2a7

Please sign in to comment.