* EPL/CTI/Addressbook: phone numbers written with unusual separator like pipe symbol where not found

This commit is contained in:
ralf 2023-04-03 16:44:18 +02:00
parent cac2508c4a
commit fc003c613b

View File

@ -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);