Skip to content

Commit

Permalink
fix(recaptcha): skip captcha on "update totals" request
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelpeixe committed Dec 12, 2023
1 parent 03d06b9 commit 2aaa84a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions includes/class-recaptcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,10 @@ public static function verify_recaptcha_on_checkout() {
if ( ! $should_verify_captcha ) {
return;
}
// Bail if validating form.
if ( isset( $_POST['woocommerce_checkout_update_totals'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
return;
}
$token = isset( $_POST['g-recaptcha-response'] ) ? sanitize_text_field( wp_unslash( $_POST['g-recaptcha-response'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing
$check = self::verify_captcha( $token );
if ( \is_wp_error( $check ) ) {
Expand Down

0 comments on commit 2aaa84a

Please sign in to comment.