From 25b24d68bd11ae97507bdd84f1fca871ab474332 Mon Sep 17 00:00:00 2001 From: Alex <40072887+alexdcrane@users.noreply.github.com> Date: Mon, 12 Jun 2023 17:06:56 -0600 Subject: [PATCH] Fixed more php 8.1 errors (#6754) * Update default_setting_edit.php * Update default_settings_reload.php * Update modules.php * Update access_controls_reload.php * Update call_recordings.php * Update fax.php * Update extension_edit.php * Update extension_imports.php * Update destination_imports.php * Update dialplan_outbound_add.php * Update dialplan_inbound_add.php * Update voicemail_imports.php * Update contact_import.php --- .../access_controls_reload.php | 4 ++-- .../resources/classes/call_recordings.php | 4 +++- app/contacts/contact_import.php | 2 +- app/destinations/destination_imports.php | 4 ++-- app/dialplan_inbound/dialplan_inbound_add.php | 6 +++--- .../dialplan_outbound_add.php | 20 +++++++++---------- app/extensions/extension_edit.php | 8 ++++---- app/extensions/extension_imports.php | 2 +- app/fax/fax.php | 6 +++--- app/modules/resources/classes/modules.php | 2 +- app/voicemails/voicemail_imports.php | 2 +- .../default_settings/default_setting_edit.php | 2 +- .../default_settings_reload.php | 2 +- 13 files changed, 33 insertions(+), 31 deletions(-) diff --git a/app/access_controls/access_controls_reload.php b/app/access_controls/access_controls_reload.php index aaa6f585f2..678d19c1ad 100644 --- a/app/access_controls/access_controls_reload.php +++ b/app/access_controls/access_controls_reload.php @@ -42,7 +42,7 @@ else { } //set the variables - $search = $_REQUEST['search']; + $search = $_REQUEST['search'] ?? ''; //create event socket connection $fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); @@ -63,4 +63,4 @@ else { header("Location: ".$location); -?> \ No newline at end of file +?> diff --git a/app/call_recordings/resources/classes/call_recordings.php b/app/call_recordings/resources/classes/call_recordings.php index 8e6f89a7a9..7ad2f08be7 100644 --- a/app/call_recordings/resources/classes/call_recordings.php +++ b/app/call_recordings/resources/classes/call_recordings.php @@ -165,6 +165,7 @@ if (!class_exists('call_recordings')) { //download the file if ($full_recording_path != '/' && file_exists($full_recording_path)) { + ob_clean(); $fd = fopen($full_recording_path, "rb"); if ($this->binary) { header("Content-Type: application/force-download"); @@ -187,12 +188,13 @@ if (!class_exists('call_recordings')) { header("Content-Length: ".filesize($full_recording_path)); } ob_clean(); - fpassthru($fd); //content-range if (isset($_SERVER['HTTP_RANGE']) && !$this->binary) { $this->range_download($full_recording_path); } + + fpassthru($fd); } //if base64, remove temp recording file diff --git a/app/contacts/contact_import.php b/app/contacts/contact_import.php index cbda01c92e..19bab8baf7 100644 --- a/app/contacts/contact_import.php +++ b/app/contacts/contact_import.php @@ -279,7 +279,7 @@ //user selected fields, labels $fields = $_POST['fields']; - $labels = $_POST['labels']; + $labels = $_POST['labels'] ?? []; //set the domain_uuid $domain_uuid = $_SESSION['domain_uuid']; diff --git a/app/destinations/destination_imports.php b/app/destinations/destination_imports.php index 3fa507ef93..1f36753266 100644 --- a/app/destinations/destination_imports.php +++ b/app/destinations/destination_imports.php @@ -501,7 +501,7 @@ fclose($handle); //save to the data - if (is_array($array)) { + if (!empty($array) && is_array($array)) { $database = new database; $database->app_name = 'destinations'; $database->app_uuid = '5ec89622-b19c-3559-64f0-afde802ab139'; @@ -1027,4 +1027,4 @@ //include the footer require_once "resources/footer.php"; -?> \ No newline at end of file +?> diff --git a/app/dialplan_inbound/dialplan_inbound_add.php b/app/dialplan_inbound/dialplan_inbound_add.php index 09935e7786..06674fb654 100644 --- a/app/dialplan_inbound/dialplan_inbound_add.php +++ b/app/dialplan_inbound/dialplan_inbound_add.php @@ -765,7 +765,7 @@ echo "\n"; echo "\n"; echo " \n"; - if ($dialplan_enabled == "true") { + if (!empty($dialplan_enabled) && $dialplan_enabled == "true") { echo " \n"; } else { echo " \n"; } - if ($dialplan_enabled == "false") { + if (!empty($dialplan_enabled) && $dialplan_enabled == "false") { echo " \n"; } else { diff --git a/app/dialplan_outbound/dialplan_outbound_add.php b/app/dialplan_outbound/dialplan_outbound_add.php index 191659220a..67dae65309 100644 --- a/app/dialplan_outbound/dialplan_outbound_add.php +++ b/app/dialplan_outbound/dialplan_outbound_add.php @@ -1007,7 +1007,7 @@ function type_onchange(dialplan_detail_type) { echo ""; echo "\n"; } - if ($row['gateway'] == $gateway_name) { + if (!empty($gateway_name) && $row['gateway'] == $gateway_name) { echo "\n"; } else { @@ -1015,7 +1015,7 @@ function type_onchange(dialplan_detail_type) { } } else { - if ($row['gateway'] == $gateway_name) { + if (!empty($gateway_name) && $row['gateway'] == $gateway_name) { echo "\n"; } else { @@ -1067,7 +1067,7 @@ function type_onchange(dialplan_detail_type) { echo " \n"; echo " \n"; } - if ($row['gateway'] == $gateway_2_name) { + if (!empty($gateway_2_name) && $row['gateway'] == $gateway_2_name) { echo " \n"; } else { @@ -1075,7 +1075,7 @@ function type_onchange(dialplan_detail_type) { } } else { - if ($row['gateway'] == $gateway_2_name) { + if (!empty($gateway_2_name) && $row['gateway'] == $gateway_2_name) { echo " \n"; } else { @@ -1127,7 +1127,7 @@ function type_onchange(dialplan_detail_type) { echo " \n"; echo " \n"; } - if ($row['gateway'] == $gateway_3_name) { + if (!empty($gateway_3_name) && $row['gateway'] == $gateway_3_name) { echo " \n"; } else { @@ -1135,7 +1135,7 @@ function type_onchange(dialplan_detail_type) { } } else { - if ($row['gateway'] == $gateway_3_name) { + if (!empty($gateway_3_name) && $row['gateway'] == $gateway_3_name) { echo " \n"; } else { @@ -1176,7 +1176,7 @@ function type_onchange(dialplan_detail_type) { echo "
\n"; echo " \n"; echo " \n"; - echo "
".$text['description-enter-custom-outbound-prefix'].".\n"; + //echo "
".$text['description-enter-custom-outbound-prefix'].".\n"; echo "
\n"; echo " \n"; //echo " \n"; - if (strlen(htmlspecialchars($dialplan_order))> 0) { + if (!empty($dialplan_order) && strlen(htmlspecialchars($dialplan_order))> 0) { echo " \n"; } $i = 100; @@ -1312,13 +1312,13 @@ function type_onchange(dialplan_detail_type) { echo "\n"; echo "