summaryrefslogtreecommitdiffstats
path: root/includes/admin/views/giglog_admin_page.php
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2021-09-17 08:55:49 +0200
committerHarald Eilertsen <haraldei@anduin.net>2021-09-17 08:55:49 +0200
commit9340fddbac59a2aab12dd0fa0e122b4d7c3bf0c8 (patch)
tree3a58480fefb2f790023d35a62462140d07144b3e /includes/admin/views/giglog_admin_page.php
parentd3fdcf53bcaf4b143c316f3379190d0053a6036f (diff)
downloadgigologadmin-9340fddbac59a2aab12dd0fa0e122b4d7c3bf0c8.tar.gz
gigologadmin-9340fddbac59a2aab12dd0fa0e122b4d7c3bf0c8.tar.bz2
gigologadmin-9340fddbac59a2aab12dd0fa0e122b4d7c3bf0c8.zip
Add CSRF checks for edit concert form.
Diffstat (limited to 'includes/admin/views/giglog_admin_page.php')
-rw-r--r--includes/admin/views/giglog_admin_page.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/includes/admin/views/giglog_admin_page.php b/includes/admin/views/giglog_admin_page.php
index 86c414e..fa853fb 100644
--- a/includes/admin/views/giglog_admin_page.php
+++ b/includes/admin/views/giglog_admin_page.php
@@ -121,8 +121,15 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) {
}
}
- if(isset($_POST['editconcert']))
+ if (isset($_POST['editconcert']))
{
+ if (!isset($_POST['giglog_edit_concert_nonce'])
+ || wp_verify_nonce($_POST['giglog_edit_concert_nonce'], plugin_basename( __FILE__ )))
+ {
+ header("{$_SERVER['SERVER_PROTOCOL']} 403 Forbidden");
+ wp_die('CSRF validation failed.', 403);
+ }
+
$roles = array_reduce(
['photo1', 'photo1', 'rev1', 'rev2'],
function($roles, $r) {