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

This commit is contained in:
Gerhard Potgieter 2018-06-27 09:05:32 +02:00
parent 3bff14974c
commit 7a3caa0608
1 changed files with 1 additions and 1 deletions

View File

@ -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 );
}
/**