From b10f1a693a9a4f73d0b84c5da76313a4452fcefe Mon Sep 17 00:00:00 2001 From: Alex P Date: Thu, 2 Feb 2023 15:26:28 +0200 Subject: [PATCH] Set $_REQUEST before validation --- modules/ppcp-button/src/Validation/CheckoutFormValidator.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/ppcp-button/src/Validation/CheckoutFormValidator.php b/modules/ppcp-button/src/Validation/CheckoutFormValidator.php index fd686b953..6e70d6d3a 100644 --- a/modules/ppcp-button/src/Validation/CheckoutFormValidator.php +++ b/modules/ppcp-button/src/Validation/CheckoutFormValidator.php @@ -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; } // And we must call get_posted_data because it handles the shipping address. $data = $this->get_posted_data();