From eaadc99e889a0a0f6cf18d42417613930c7245d1 Mon Sep 17 00:00:00 2001 From: markjcrane Date: Sat, 7 May 2016 12:28:07 -0600 Subject: [PATCH] To prevent all warnings for XML CDR Details check all arrays. --- app/xml_cdr/xml_cdr_details.php | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/app/xml_cdr/xml_cdr_details.php b/app/xml_cdr/xml_cdr_details.php index edfc3cf83d..3ff8ce62ff 100644 --- a/app/xml_cdr/xml_cdr_details.php +++ b/app/xml_cdr/xml_cdr_details.php @@ -147,7 +147,7 @@ else { $array["callflow"][0] = $tmp; } $x = 0; - foreach ($array["callflow"] as $row) { + if (is_array($array["callflow"]) foreach ($array["callflow"] as $row) { if ($x == 0) { $destination_number = check_str(urldecode($row["caller_profile"]["destination_number"])); $context = check_str(urldecode($row["caller_profile"]["context"])); @@ -159,7 +159,6 @@ else { } unset($x); - $tmp_year = date("Y", strtotime($start_stamp)); $tmp_month = date("M", strtotime($start_stamp)); $tmp_day = date("d", strtotime($start_stamp)); @@ -241,7 +240,7 @@ else { echo "".$text['label-name']."\n"; echo "".$text['label-value']."\n"; echo "\n"; - foreach($array["channel_data"] as $key => $value) { + if (is_array($array["channel_data"]) foreach($array["channel_data"] as $key => $value) { $value = urldecode($value); echo "\n"; echo " ".$key." \n"; @@ -268,7 +267,7 @@ else { echo "".$text['label-name']."\n"; echo "".$text['label-value']."\n"; echo "\n"; - foreach($array["variables"] as $key => $value) { + if (is_array($array["variables"]) foreach($array["variables"] as $key => $value) { if (is_array($value)) { $value = implode($value); } $value = urldecode($value); if ($key != "digits_dialed" && $key != "dsn") { @@ -331,7 +330,7 @@ else { echo "\n"; //foreach($array["variables"] as $key => $value) { - foreach ($array["app_log"]["application"] as $row) { + if (is_array($array["app_log"]["application"])) foreach ($array["app_log"]["application"] as $row) { $app_name = $row["@attributes"]["app_name"]; $app_data = urldecode($row["@attributes"]["app_data"]); echo "\n"; @@ -347,7 +346,7 @@ else { $c = 0; $row_style["0"] = "row_style0"; $row_style["1"] = "row_style1"; - foreach ($array["callflow"] as $row) { + if (is_array($array["callflow"]) foreach ($array["callflow"] as $row) { echo "\n"; echo "\n"; @@ -366,7 +365,7 @@ else { echo " \n"; echo " \n"; echo " \n"; - foreach($row["@attributes"] as $key => $value) { + if (is_array($row["@attributes"]) foreach($row["@attributes"] as $key => $value) { $value = urldecode($value); echo " \n"; echo " \n"; @@ -392,7 +391,7 @@ else { echo " \n"; echo " \n"; echo " \n"; - foreach($row["extension"]["@attributes"] as $key => $value) { + if (is_array($row["extension"]["@attributes"]) foreach($row["extension"]["@attributes"] as $key => $value) { $value = urldecode($value); echo " \n"; echo " \n"; @@ -418,7 +417,7 @@ else { echo " \n"; echo " \n"; echo " \n"; - foreach ($row["extension"]["application"] as $tmp_row) { + if (is_array($row["extension"]["application"]) foreach ($row["extension"]["application"] as $tmp_row) { $app_name = $tmp_row["@attributes"]["app_name"]; $app_data = urldecode($tmp_row["@attributes"]["app_data"]); echo " \n"; @@ -445,7 +444,7 @@ else { echo " \n"; echo " \n"; echo " \n"; - foreach($row["caller_profile"] as $key => $value) { + if (is_array($row["caller_profile"]) foreach($row["caller_profile"] as $key => $value) { if (is_array($value)) { $value = implode($value); } $value = urldecode($value); echo " \n"; @@ -493,7 +492,7 @@ else { echo " \n"; echo " \n"; echo " \n"; - foreach($row["times"] as $key => $value) { + if (is_array($row["times"]) foreach($row["times"] as $key => $value) { $value = urldecode($value); echo " \n"; echo " \n";
".$text['label-name']."".$text['label-value']."
".$key." ".$text['label-name']."".$text['label-value']."
".$key." ".$text['label-name']."".$text['label-data']."
".$text['label-name']."".$text['label-value']."
".$text['label-name']."".$text['label-value']."
".$key."