Set the export_format

To prevent null and prevent unintended behavior set an empty string to as the default export format.
This commit is contained in:
FusionPBX
2023-05-12 14:30:16 -06:00
committed by GitHub
parent 9dc8bcf7e9
commit 590faa4e83

View File

@@ -50,7 +50,6 @@
$_GET['show'] = 'false';
}
//get post or get variables from http
if (count($_REQUEST) > 0) {
$cdr_id = $_REQUEST["cdr_id"] ?? '';
@@ -119,6 +118,14 @@
$leg = 'a';
}
//set the export_format
if (isset($_REQUEST['export_format'])) {
$export_format = $_REQUEST['export_format'];
}
else {
$export_format = '';
}
//validate the order
switch ($order) {
case 'asc':
@@ -577,7 +584,7 @@
if (!empty($order_by)) {
$sql .= order_by($order_by, $order);
}
if (isset($_REQUEST['export_format']) && $_REQUEST['export_format'] !== "csv" && $_REQUEST['export_format'] !== "pdf") {
if ($export_format !== "csv" && $export_format !== "pdf") {
if ($rows_per_page == 0) {
$sql .= " limit :limit offset 0 \n";
$parameters['limit'] = $_SESSION['cdr']['limit']['numeric'];