mirror of
https://github.com/Neetpone/ponepaste.git
synced 2025-03-11 14:10:06 +01:00
fix: paste_action and user_action CSRF
This commit is contained in:
parent
483d0293f7
commit
239f1f92fe
2 changed files with 3 additions and 5 deletions
|
@ -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'])) {
|
||||
|
|
|
@ -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'])) {
|
||||
|
|
Loading…
Add table
Reference in a new issue