Skip to content

Commit

Permalink
Merge pull request #1157 from woocommerce/PCP-1138-recaptcha-validation
Browse files Browse the repository at this point in the history
Set $_REQUEST before validation
  • Loading branch information
Dinamiko authored Feb 10, 2023
2 parents 9518a5c + b10f1a6 commit 4aab613
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modules/ppcp-button/src/Validation/CheckoutFormValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ class CheckoutFormValidator extends WC_Checkout {
public function validate( array $data ) {
$errors = new WP_Error();

// Some plugins check their fields using $_POST,
// Some plugins check their fields using $_POST or $_REQUEST,
// also WC terms checkbox https://github.com/woocommerce/woocommerce/issues/35328 .
foreach ( $data as $key => $value ) {
$_POST[ $key ] = $value;
$_POST[ $key ] = $value;
$_REQUEST[ $key ] = $value;
}

// Looks like without this WC()->shipping->get_packages() is empty which is used by some plugins.
Expand Down

0 comments on commit 4aab613

Please sign in to comment.