From e2ed8d34b9ac8bf0cfefa4c5f5ee45e93cc8dde2 Mon Sep 17 00:00:00 2001 From: Mahdi Yazdani Date: Sat, 2 Sep 2023 18:33:47 +0300 Subject: [PATCH] fix: Sanitize coupon code --- src/WooCommerce/Checkout.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WooCommerce/Checkout.php b/src/WooCommerce/Checkout.php index 0cbe132..c51ece2 100644 --- a/src/WooCommerce/Checkout.php +++ b/src/WooCommerce/Checkout.php @@ -93,7 +93,7 @@ public function apply_coupon_via_url() { return; } - WC()->cart->add_discount( wc_clean( $coupon_code ) ); + WC()->cart->add_discount( wc_sanitize_coupon_code( $coupon_code ) ); } /**