Skip to content

Commit

Permalink
Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamadNateqi committed Nov 10, 2023
1 parent 466497b commit 305f492
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions includes/class-wcpdf-main.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,9 @@ public function generate_document_ajax() {
$access_type = WPO_WCPDF()->endpoint->get_document_link_access_type();
$redirect_url = WPO_WCPDF()->endpoint->get_document_denied_frontend_redirect_url();

// handle the bulk order access key
if ( empty( $_REQUEST['access_key'] ) ) {
foreach ( array( '_wpnonce', 'order_key' ) as $legacy_key ) {
if ( ! empty( $_REQUEST[ $legacy_key ] ) ) {
$_REQUEST['access_key'] = sanitize_text_field( $_REQUEST[ $legacy_key ] );
}
}
// handle the bulk order access key
if ( empty( $_REQUEST['access_key'] ) && ! empty( $_REQUEST['_wpnonce'] ) ) {
$_REQUEST['access_key'] = sanitize_text_field( $_REQUEST['_wpnonce'] );
}

$valid_nonce = ! empty( $_REQUEST['access_key'] ) && ! empty( $_REQUEST['action'] ) && wp_verify_nonce( $_REQUEST['access_key'], $_REQUEST['action'] );
Expand Down

0 comments on commit 305f492

Please sign in to comment.