Skip to content

Commit 56079c2

Browse files
authored
Merge pull request #209 from BoldGrid/isssue-139
adds nonce and role verification to entry exports.
2 parents 74812cc + 245e828 commit 56079c2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

includes/admin/class-admin.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,17 @@ public function export_forms() {
170170
* @return void
171171
*/
172172
public function export_form_entries() {
173+
if ( ! current_user_can( 'administrator' ) ) {
174+
wp_die( esc_html__( 'You do not have permission to export entries', 'weforms' ) );
175+
}
176+
177+
if ( ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'weforms-export-entries' ) ) {
178+
wp_die( esc_html__( 'Invalid nonce', 'weforms' ) );
179+
}
180+
173181
$form_id = isset( $_REQUEST['selected_forms'] ) ? absint( $_REQUEST['selected_forms'] ) : 0;
174182

175-
if ( !$form_id ) {
183+
if ( ! $form_id ) {
176184
return;
177185
}
178186

0 commit comments

Comments
 (0)