From 2f979a312cc52312629c7495336146f6618dc2c9 Mon Sep 17 00:00:00 2001 From: ralf Date: Mon, 3 Apr 2023 16:44:18 +0200 Subject: [PATCH] * EPL/CTI/Addressbook: phone numbers written with unusual separator like pipe symbol where not found --- api/src/Contacts.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/src/Contacts.php b/api/src/Contacts.php index b9fd3ac13a..77aa84ae6e 100755 --- a/api/src/Contacts.php +++ b/api/src/Contacts.php @@ -2934,7 +2934,8 @@ class Contacts extends Contacts\Storage if (substr($name, 0, 4) === 'tel_' && !empty($value)) { try { - $tel = $phoneNumberUtil->parse($value, + // we sanitize the number a little, as phoneNumberUtil e.g. chokes on pipe char ("|") when used in phone numbers + $tel = $phoneNumberUtil->parse(preg_replace('/[^+0-9()\/ -]+/', '', $value), // prefer region of contact, to eg. be able to parse US numbers starting direct with areacode but no leading 0 $row[substr($name, -5) === '_home' ? 'adr_two_countrycode' : 'adr_one_countrycode'] ?: $row['adr_one_countrycode'] ?: $region);