Sanitize the caller ID name and number

This commit is contained in:
FusionPBX
2024-12-20 11:08:47 -07:00
committed by GitHub
parent d463a7c5b3
commit 0af94ee1e3

View File

@@ -240,6 +240,7 @@ if (!class_exists('xml_cdr')) {
//save the call details record to the database
$this->database->app_name = 'xml_cdr';
$this->database->app_uuid = '4a085c51-7635-ff03-f67b-86e834422848';
//$this->database->domain_uuid = $domain_uuid;
$response = $this->database->save($this->array, false);
if ($response['code'] == '200') {
@@ -614,6 +615,10 @@ if (!class_exists('xml_cdr')) {
$domain_name = urldecode($xml->variables->domain_name);
$domain_uuid = urldecode($xml->variables->domain_uuid);
//sanitize the caller ID
$caller_id_name = preg_replace('#[^a-zA-Z 0-9\-\.]#', '', $caller_id_name);
$caller_id_number = preg_replace('#[^0-9\-]#', '', $caller_id_number);
//misc
$this->array[$key][0]['xml_cdr_uuid'] = $uuid;
$this->array[$key][0]['destination_number'] = $destination_number;
@@ -2263,5 +2268,3 @@ if (!class_exists('xml_cdr')) {
} //class
}
?>