From 694d7017577d7b0f6f74e80990af5ff04b70189a Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Mon, 16 Oct 2023 09:55:20 -0600 Subject: [PATCH] Auto decode when urlencoding is detected --- app/xml_cdr/resources/classes/xml_cdr.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/xml_cdr/resources/classes/xml_cdr.php b/app/xml_cdr/resources/classes/xml_cdr.php index 52c44d870b..320a4575d4 100644 --- a/app/xml_cdr/resources/classes/xml_cdr.php +++ b/app/xml_cdr/resources/classes/xml_cdr.php @@ -993,16 +993,18 @@ if (!class_exists('xml_cdr')) { //import the call detail files are less than 3 mb - 3 million bytes if ($import && filesize($xml_cdr_dir.'/'.$file) <= 3000000) { //get the xml cdr string - $xml_string = file_get_contents($xml_cdr_dir.'/'.$file); + $call_details = file_get_contents($xml_cdr_dir.'/'.$file); //set the file $this->file = $file; //decode the xml string - //$xml_string = urldecode($xml_string); + if (substr($call_details, 0, 1) == '%') { + $call_details = urldecode($call_details); + } //parse the xml and insert the data into the db - $this->xml_array($x, $leg, $xml_string); + $this->xml_array($x, $leg, $call_details); //increment the value $x++;