Skip to content

Commit

Permalink
fix: Vendor can send multiple withdraw request issue fixed (#890)
Browse files Browse the repository at this point in the history
  • Loading branch information
alamgircsebd authored Aug 20, 2020
1 parent 2c5d71b commit c58a4f2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions includes/Dashboard/Templates/Withdraw.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,14 @@ protected function handle_cancel_request() {
* @return void
*/
protected function handle_approval_request() {
global $current_user;

$post_data = wp_unslash( $_POST );

if ( dokan()->withdraw->has_pending_request( $current_user->ID ) ) {
return;
}

if ( ! isset( $post_data['dokan_withdraw_nonce'] ) || ! wp_verify_nonce( sanitize_key( $post_data['dokan_withdraw_nonce'] ), 'dokan_withdraw' ) ) {
$this->add_error( esc_html__( 'Are you cheating?', 'dokan-lite' ) );
}
Expand Down

0 comments on commit c58a4f2

Please sign in to comment.