Skip to content

Commit a720730

Browse files
authored
Merge pull request #485 from wpengine/bug-fix-logging-nonce-issue
chore: Added nonce for the detail page for the download link.
2 parents 0defaee + 3741a12 commit a720730

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.changeset/curly-phones-look.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@wpengine/wpgraphql-logging-wordpress-plugin": patch
3+
---
4+
5+
chore: Added nonce for the detail page for the download link.

plugins/wpgraphql-logging/src/Admin/View/Templates/WPGraphQLLoggerView.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
declare(strict_types=1);
44

5+
use WPGraphQL\Logging\Admin\ViewLogsPage;
6+
57
/**
68
* Log detail view template.
79
*
@@ -17,13 +19,15 @@
1719
<h1><?php esc_html_e( 'Log Entry', 'wpgraphql-logging' ); ?></h1>
1820
<a href="
1921
<?php
22+
$wpgraphql_logging_download_nonce = wp_create_nonce( ViewLogsPage::ADMIN_PAGE_DOWNLOAD_NONCE . '_' . $log->get_id() );
2023
echo esc_url(
2124
admin_url(
2225
sprintf(
23-
'admin.php?page=%s&action=%s&log=%d',
26+
'admin.php?page=%s&action=%s&log=%d&_wpnonce=%s',
2427
\WPGraphQL\Logging\Admin\ViewLogsPage::ADMIN_PAGE_SLUG,
2528
'download',
26-
$log->get_id()
29+
$log->get_id(),
30+
$wpgraphql_logging_download_nonce
2731
)
2832
)
2933
);

0 commit comments

Comments
 (0)