mirror of
https://github.com/Neetpone/ponepaste.git
synced 2025-03-12 06:30:07 +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()) {
|
if (!verifyCsrfToken()) {
|
||||||
flashError('Invalid CSRF token (do you have cookies enabled?)');
|
flashError('Invalid CSRF token (do you have cookies enabled?)');
|
||||||
|
header('Location: ' . urlForPaste($paste));
|
||||||
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_POST['hide'])) {
|
if (isset($_POST['hide'])) {
|
||||||
|
|
|
@ -18,11 +18,7 @@ if (!$user) {
|
||||||
|
|
||||||
if (!verifyCsrfToken()) {
|
if (!verifyCsrfToken()) {
|
||||||
flashError('Invalid CSRF token (do you have cookies enabled?)');
|
flashError('Invalid CSRF token (do you have cookies enabled?)');
|
||||||
}
|
} elseif (!can('administrate', $user)) {
|
||||||
|
|
||||||
$can_administrate = can('administrate', $user);
|
|
||||||
|
|
||||||
if (!$can_administrate) {
|
|
||||||
flashError('Error: You do not have permission to administrate this user.');
|
flashError('Error: You do not have permission to administrate this user.');
|
||||||
} else {
|
} else {
|
||||||
if (isset($_POST['reset_password'])) {
|
if (isset($_POST['reset_password'])) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue