From 7a3caa0608c2868d4281330a7d35ae4ac55bea85 Mon Sep 17 00:00:00 2001 From: Gerhard Potgieter Date: Wed, 27 Jun 2018 09:05:32 +0200 Subject: [PATCH] This changes wc_format_phone_number to discard all characters except numbers and the + sign, not sure if + sign must be stripped but in the current version it was not stripping the + sign --- includes/wc-formatting-functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/wc-formatting-functions.php b/includes/wc-formatting-functions.php index b9d69b3884c..a1bbb185d54 100644 --- a/includes/wc-formatting-functions.php +++ b/includes/wc-formatting-functions.php @@ -941,7 +941,7 @@ function wc_normalize_postcode( $postcode ) { * @return string */ function wc_format_phone_number( $phone ) { - return str_replace( '.', '-', $phone ); + return preg_replace( '/[^0-9\+]/', '', $phone ); } /**