From e5e64d161868b89a876b796eee8c321c8f8ff3c2 Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Thu, 7 Mar 2019 14:08:40 -0300 Subject: [PATCH] Apply wc_sanitize_phone_number in WC_Gateway_Paypal_Request --- .../paypal/includes/class-wc-gateway-paypal-request.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/gateways/paypal/includes/class-wc-gateway-paypal-request.php b/includes/gateways/paypal/includes/class-wc-gateway-paypal-request.php index 2cf02c6d4d6..4cd746197b1 100644 --- a/includes/gateways/paypal/includes/class-wc-gateway-paypal-request.php +++ b/includes/gateways/paypal/includes/class-wc-gateway-paypal-request.php @@ -216,7 +216,7 @@ class WC_Gateway_Paypal_Request { * @return array */ protected function get_phone_number_args( $order ) { - $phone_number = str_replace( array( '(', '-', ' ', ')', '.' ), '', $order->get_billing_phone() ); + $phone_number = wc_sanitize_phone_number( $order->get_billing_phone() ); if ( in_array( $order->get_billing_country(), array( 'US', 'CA' ), true ) ) { $phone_number = ltrim( $phone_number, '+1' );