Update functions.php
handle phone_mask option
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user