From f4c141f6ef07111d16327990c3628502e13a95a5 Mon Sep 17 00:00:00 2001 From: fusionate Date: Mon, 29 May 2023 18:30:31 +0000 Subject: [PATCH] Extension Summary: Updates for PHP 8.1 --- app/xml_cdr/xml_cdr_extension_summary.php | 68 ++++++++++++----------- 1 file changed, 36 insertions(+), 32 deletions(-) diff --git a/app/xml_cdr/xml_cdr_extension_summary.php b/app/xml_cdr/xml_cdr_extension_summary.php index 865c3cefaf..535f6f17ae 100644 --- a/app/xml_cdr/xml_cdr_extension_summary.php +++ b/app/xml_cdr/xml_cdr_extension_summary.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2020 + Portions created by the Initial Developer are Copyright (C) 2008-2023 the Initial Developer. All Rights Reserved. Contributor(s): @@ -47,23 +47,27 @@ $text = $language->get(); //retrieve submitted data - $quick_select = $_REQUEST['quick_select']; - $start_stamp_begin = $_REQUEST['start_stamp_begin']; - $start_stamp_end = $_REQUEST['start_stamp_end']; - $include_internal = $_REQUEST['include_internal']; - $quick_select = sizeof($_REQUEST) == 0 ? 3 : $quick_select; //set default + if (!empty($_REQUEST)) { + $quick_select = $_REQUEST['quick_select']; + $start_stamp_begin = $_REQUEST['start_stamp_begin']; + $start_stamp_end = $_REQUEST['start_stamp_end']; + $include_internal = $_REQUEST['include_internal']; + } + else { + $quick_select = 3; //set default + } //get the summary $cdr = new xml_cdr; $cdr->domain_uuid = $_SESSION['domain_uuid']; $cdr->quick_select = $quick_select; - $cdr->start_stamp_begin = $start_stamp_begin; - $cdr->start_stamp_end = $start_stamp_end; - $cdr->include_internal = $include_internal; + $cdr->start_stamp_begin = $start_stamp_begin ?? null; + $cdr->start_stamp_end = $start_stamp_end ?? null; + $cdr->include_internal = $include_internal ?? null; $summary = $cdr->user_summary(); //set the http header - if ($_REQUEST['type'] == "csv") { + if (!empty($_REQUEST['type']) && $_REQUEST['type'] == "csv") { //set the headers header('Content-type: application/octet-binary'); @@ -149,24 +153,6 @@ echo " \n"; echo " \n"; - echo "
\n"; - echo "
\n"; - echo " ".$text['label-start_date_time']."\n"; - echo "
\n"; - echo "
\n"; - echo " \n"; - echo "
\n"; - echo "
\n"; - - echo "
\n"; - echo "
\n"; - echo " ".$text['label-end_date_time']."\n"; - echo "
\n"; - echo "
\n"; - echo " \n"; - echo "
\n"; - echo "
\n"; - echo "
\n"; echo "
\n"; echo " ".$text['label-include_internal']."\n"; @@ -179,9 +165,27 @@ echo "
\n"; echo "
\n"; + echo "
\n"; + echo "
\n"; + echo " ".$text['label-start_date_time']."\n"; + echo "
\n"; + echo "
\n"; + echo " \n"; + echo "
\n"; + echo "
\n"; + + echo "
\n"; + echo "
\n"; + echo " ".$text['label-end_date_time']."\n"; + echo "
\n"; + echo "
\n"; + echo " \n"; + echo "
\n"; + echo "
\n"; + echo "\n"; - if (permission_exists('xml_cdr_extension_summary_all') && $_GET['show'] == 'all') { + if (!empty($_GET['show']) && $_GET['show'] == 'all' && permission_exists('xml_cdr_extension_summary_all')) { echo ""; } @@ -191,7 +195,7 @@ //show the results echo "\n"; echo " \n"; - if ($_GET['show'] === "all" && permission_exists('xml_cdr_extension_summary_all')) { + if (!empty($_GET['show']) && $_GET['show'] === "all" && permission_exists('xml_cdr_extension_summary_all')) { echo " \n"; } echo " \n"; @@ -213,7 +217,7 @@ if (is_array($summary)) { foreach ($summary as $key => $row) { echo "\n"; - if ($_GET['show'] === "all" && permission_exists('xml_cdr_extension_summary_all')) { + if (!empty($_GET['show']) && $_GET['show'] === "all" && permission_exists('xml_cdr_extension_summary_all')) { echo " \n"; } echo " \n"; @@ -240,4 +244,4 @@ //show the footer require_once "resources/footer.php"; -?> +?> \ No newline at end of file
".$text['label-domain']."".$text['label-extension']."
".escape($row['domain_name'])."".escape($row['extension'])."