mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 19:53:56 +00:00
Registrations - More work to remove invalid characters that break XML.
This commit is contained in:
@@ -89,6 +89,7 @@ if (!class_exists('registrations')) {
|
|||||||
$cmd = "api sofia xmlstatus profile ".$field['sip_profile_name']." reg";
|
$cmd = "api sofia xmlstatus profile ".$field['sip_profile_name']." reg";
|
||||||
$xml_response = trim(event_socket_request($fp, $cmd));
|
$xml_response = trim(event_socket_request($fp, $cmd));
|
||||||
$xml_response = iconv("utf-8", "utf-8//ignore", $xml_response);
|
$xml_response = iconv("utf-8", "utf-8//ignore", $xml_response);
|
||||||
|
$xml_response = preg_replace('/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/u', '', $xml_response);
|
||||||
if ($xml_response == "Invalid Profile!") { $xml_response = "<error_msg>".$text['label-message']."</error_msg>"; }
|
if ($xml_response == "Invalid Profile!") { $xml_response = "<error_msg>".$text['label-message']."</error_msg>"; }
|
||||||
$xml_response = str_replace("<profile-info>", "<profile_info>", $xml_response);
|
$xml_response = str_replace("<profile-info>", "<profile_info>", $xml_response);
|
||||||
$xml_response = str_replace("</profile-info>", "</profile_info>", $xml_response);
|
$xml_response = str_replace("</profile-info>", "</profile_info>", $xml_response);
|
||||||
@@ -99,9 +100,10 @@ if (!class_exists('registrations')) {
|
|||||||
$xml = new SimpleXMLElement($xml_response);
|
$xml = new SimpleXMLElement($xml_response);
|
||||||
}
|
}
|
||||||
catch(Exception $e) {
|
catch(Exception $e) {
|
||||||
echo basename(__FILE__).'<br />';
|
echo basename(__FILE__)."<br />\n";
|
||||||
echo 'line: '.__line__.'<br />';
|
echo "line: ".__line__."<br />\n";
|
||||||
echo 'error: '.$e->getMessage();
|
echo "error: ".$e->getMessage()."<br />\n";
|
||||||
|
//echo $xml_response;
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
$array = json_decode(json_encode($xml), true);
|
$array = json_decode(json_encode($xml), true);
|
||||||
|
|||||||
Reference in New Issue
Block a user