fix: paste_action and user_action CSRF

This commit is contained in:
Floorb 2023-07-11 03:22:14 -04:00
parent 483d0293f7
commit 239f1f92fe
2 changed files with 3 additions and 5 deletions

View file

@ -19,6 +19,8 @@ if (!$paste) {
if (!verifyCsrfToken()) {
flashError('Invalid CSRF token (do you have cookies enabled?)');
header('Location: ' . urlForPaste($paste));
die();
}
if (isset($_POST['hide'])) {

View file

@ -18,11 +18,7 @@ if (!$user) {
if (!verifyCsrfToken()) {
flashError('Invalid CSRF token (do you have cookies enabled?)');
}
$can_administrate = can('administrate', $user);
if (!$can_administrate) {
} elseif (!can('administrate', $user)) {
flashError('Error: You do not have permission to administrate this user.');
} else {
if (isset($_POST['reset_password'])) {