Set $_REQUEST before validation

This commit is contained in:
Alex P 2023-02-02 15:26:28 +02:00
parent fddd6c35e9
commit b10f1a693a
No known key found for this signature in database
GPG key ID: 54487A734A204D71

View file

@ -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();