From 8d82246a3d797d2a797ea59c8cd77830d6582fc9 Mon Sep 17 00:00:00 2001 From: Javan Griffiths Date: Wed, 10 Nov 2021 12:12:12 +1100 Subject: [PATCH] Fix errors within getFormatedPhone method --- src/twigextensions/Extension.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/twigextensions/Extension.php b/src/twigextensions/Extension.php index 03daa03..2c56a39 100644 --- a/src/twigextensions/Extension.php +++ b/src/twigextensions/Extension.php @@ -57,13 +57,13 @@ public function svgPlaceholder($width, $height = null) return 'data:image/svg+xml;base64,' . base64_encode($src); } - public function getFormattedPhone($value) + public function getFormattedPhone($phone) { // Strip out any non-numbers - $formattedPhone = str_replace('/[^0-9]/', '', $phone); + $formattedPhone = preg_replace('/[^0-9]/', '', $phone); // Format area code, and prepend '+61' - $formattedPhone = str_replace('/^0/', '+61', $formattedPhone); + $formattedPhone = preg_replace('/^0/', '+61', $formattedPhone); return $formattedPhone; }