Skip to content

Commit

Permalink
Fix redirects in forum + polls
Browse files Browse the repository at this point in the history
  • Loading branch information
slawkens committed Apr 14, 2024
1 parent eb0c2a7 commit d5915df
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion system/pages/account/manage.php
Expand Up @@ -21,7 +21,7 @@
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.');
Expand Down
2 changes: 1 addition & 1 deletion system/pages/forum/edit_post.php
Expand Up @@ -19,7 +19,7 @@
}

if(!$logged) {
echo 'You are not logged in. <a href="' . getLink('account/manage') . '?redirect=' . BASE_URL . urlencode(getLink('forum')) . '">Log in</a> to post on the forum.<br /><br />';
echo 'You are not logged in. <a href="' . getLink('account/manage') . '?redirect=' . urlencode(getLink('forum')) . '">Log in</a> to post on the forum.<br /><br />';
return;
}

Expand Down
2 changes: 1 addition & 1 deletion system/pages/forum/move_thread.php
Expand Up @@ -19,7 +19,7 @@
}

if(!$logged) {
echo 'You are not logged in. <a href="' . getLink('account/manage') . '?redirect=' . BASE_URL . urlencode(getLink('forum')) . '">Log in</a> to post on the forum.<br /><br />';
echo 'You are not logged in. <a href="' . getLink('account/manage') . '?redirect=' . urlencode(getLink('forum')) . '">Log in</a> to post on the forum.<br /><br />';
return;
}

Expand Down
2 changes: 1 addition & 1 deletion system/pages/forum/new_post.php
Expand Up @@ -24,7 +24,7 @@
$extra_url = '?action=new_post&thread_id=' . $_GET['thread_id'];
}

echo 'You are not logged in. <a href="' . getLink('account/manage') . '?redirect=' . BASE_URL . urlencode(getLink('forum') . $extra_url) . '">Log in</a> to post on the forum.<br /><br />';
echo 'You are not logged in. <a href="' . getLink('account/manage') . '?redirect=' . urlencode(getLink('forum') . $extra_url) . '">Log in</a> to post on the forum.<br /><br />';
return;
}

Expand Down
2 changes: 1 addition & 1 deletion system/pages/forum/new_thread.php
Expand Up @@ -24,7 +24,7 @@
$extra_url = '?action=new_thread&section_id=' . $_GET['section_id'];
}

echo 'You are not logged in. <a href="' . getLink('account/manage') . '?redirect=' . BASE_URL . urlencode(getLink('forum') . $extra_url) . '">Log in</a> to post on the forum.<br /><br />';
echo 'You are not logged in. <a href="' . getLink('account/manage') . '?redirect=' . urlencode(getLink('forum') . $extra_url) . '">Log in</a> to post on the forum.<br /><br />';
return;
}

Expand Down
2 changes: 1 addition & 1 deletion system/pages/forum/remove_post.php
Expand Up @@ -19,7 +19,7 @@
}

if(!$logged) {
echo 'You are not logged in. <a href="' . getLink('account/manage') . '?redirect=' . BASE_URL . urlencode(getLink('forum')) . '">Log in</a> to post on the forum.<br /><br />';
echo 'You are not logged in. <a href="' . getLink('account/manage') . '?redirect=' . urlencode(getLink('forum')) . '">Log in</a> to post on the forum.<br /><br />';
return;
}

Expand Down
4 changes: 2 additions & 2 deletions system/pages/polls.php
Expand Up @@ -51,7 +51,7 @@ function getColorByPercent($percent)
if($logged)
echo $link.'?id='.$poll['id'];
else
echo getLink('account/manage') . '?redirect=' . BASE_URL . urlencode($link.'?id='.$poll['id']);
echo getLink('account/manage') . '?redirect=' . urlencode($link.'?id='.$poll['id']);

echo '">'.$poll['question'] . '</a>
</td>
Expand Down Expand Up @@ -80,7 +80,7 @@ function getColorByPercent($percent)
if($logged)
echo $link.'?id='.$poll['id'];
else
echo getLink('account/manage') . '?redirect=' . BASE_URL . urlencode($link.'?id='.$poll['id']);
echo getLink('account/manage') . '?redirect=' . urlencode($link.'?id='.$poll['id']);

echo '">'.$poll['question'] . '</a>
</td>
Expand Down

0 comments on commit d5915df

Please sign in to comment.