From 34e48ad804ef613d83f184cf33a938cbfd7400b9 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Fri, 17 Sep 2021 08:57:39 +0200 Subject: Return better error for failed CSRF check on import. --- includes/admin/views/giglog_import_gigs.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'includes') diff --git a/includes/admin/views/giglog_import_gigs.php b/includes/admin/views/giglog_import_gigs.php index 193cd9e..1a72fe1 100644 --- a/includes/admin/views/giglog_import_gigs.php +++ b/includes/admin/views/giglog_import_gigs.php @@ -31,8 +31,8 @@ if ( !class_exists( 'GiglogAdmin_ImportGigsPage' ) ) { GiglogAdmin_ImportGigsPage::process_upload($_FILES['giglog_import_file']); } else { - header('HTTP/1.1 400 Bad Request'); - wp_die('Bad request', 400); + header("{$_SERVER['SERVER_PROTOCOL']} 403 Forbidden"); + wp_die('CSRF validation failed.', 403); } } } -- cgit v1.2.3