| @@ -169,11 +169,19 @@ | ||
| 169 | 169 | * |
| 170 | 170 | * @return void |
| 171 | 171 | */ |
| 172 | 172 | 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 | + | |
| 173 | 181 | $form_id = isset( $_REQUEST['selected_forms'] ) ? absint( $_REQUEST['selected_forms'] ) : 0; |
| 174 | 182 | |
| 175 | - if ( !$form_id ) { | |
| 183 | + if ( ! $form_id ) { | |
| 176 | 184 | return; |
| 177 | 185 | } |
| 178 | 186 | |
| 179 | 187 | $entry_array = []; |