From 54e93c8beb8fb0df3482ed60b570dd4ebad86080 Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Sat, 4 Apr 2015 16:09:11 +0000 Subject: [PATCH] XML CDR, Add a fix for unescaped data in . --- app/xml_cdr/v_xml_cdr_import.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/xml_cdr/v_xml_cdr_import.php b/app/xml_cdr/v_xml_cdr_import.php index cdf97d0a22..5af4a770d7 100644 --- a/app/xml_cdr/v_xml_cdr_import.php +++ b/app/xml_cdr/v_xml_cdr_import.php @@ -90,6 +90,12 @@ $match_result = str_replace(">", ">", $match_result); $xml_string = str_replace($matches[1], $match_result, $xml_string); + //fix the xml by escaping the contents of + preg_match("/(.*)<\/sip_Remote-Party-ID>/", $xml_string, $matches); + $match_result = str_replace("<", "<", $matches[1]); + $match_result = str_replace(">", ">", $match_result); + $xml_string = str_replace($matches[1], $match_result, $xml_string); + //parse the xml to get the call detail record info try { $xml = simplexml_load_string($xml_string);