Update functions.php

handle phone_mask option
This commit is contained in:
Hugo Sampaio
2024-05-06 11:31:38 -03:00
parent e677292875
commit b1efb76b3b
+10
View File
@@ -212,6 +212,16 @@ function truncate($text, $chars)
function formatPhoneNumber($phoneNumber)
{
global $mysqli;
// Get Phone Mask Option
$phone_mask = mysqli_fetch_array(mysqli_query($mysqli, "SELECT config_phone_mask FROM settings WHERE company_id = 1"))[0];
if ($phone_mask == 0) {
return $phoneNumber;
}
$phoneNumber = $phoneNumber ? preg_replace('/[^0-9]/', '', $phoneNumber) : "";
if (strlen($phoneNumber) > 10) {