From 791be82f274fcbe41010c2ccf1ee15ba4783ece4 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Mon, 5 Jun 2023 12:39:00 -0600 Subject: [PATCH] Fix PHP 8.1 errors --- app/voicemails/app_defaults.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/voicemails/app_defaults.php b/app/voicemails/app_defaults.php index af2c9186db..2e4b25293a 100644 --- a/app/voicemails/app_defaults.php +++ b/app/voicemails/app_defaults.php @@ -35,7 +35,7 @@ if ($domains_processed == 1) { $database = new database; $voicemails = $database->select($sql, null, 'all'); unset($sql, $parameters); - if (is_array($voicemails) && @sizeof($voicemails) != 0) { + if (!empty($voicemails) && is_array($voicemails) && @sizeof($voicemails) != 0) { foreach($voicemails as $row) { if (is_numeric($row['voicemail_id'])) { if (!file_exists($_SESSION['switch']['voicemail']['dir']."/default/".$row['domain_name']."/".$row['voicemail_id'])) { @@ -46,7 +46,7 @@ if ($domains_processed == 1) { } //define initial, get current, define correct languages folder paths - $switch_configuration_dir = $_SESSION['switch']['conf']['dir'] != '' ? $_SESSION['switch']['conf']['dir'] : '/etc/freeswitch'; + $switch_configuration_dir = !empty($_SESSION['switch']['conf']['dir']) ? $_SESSION['switch']['conf']['dir'] : '/etc/freeswitch'; $switch_languages_dir_initial = $switch_configuration_dir.'/lang'; $switch_languages_dir_current = $_SESSION['switch']['languages']['dir']; $switch_languages_dir_correct = $switch_configuration_dir.'/languages'; @@ -85,7 +85,7 @@ if ($domains_processed == 1) { @file_put_contents($switch_configuration_dir.'/freeswitch.xml', $switch_xml_content); } $folder_contents = scandir($switch_languages_dir_correct); - if (is_array($folder_contents) && @sizeof($folder_contents) != 0) { + if (!empty($folder_contents) && is_array($folder_contents) && @sizeof($folder_contents) != 0) { foreach ($folder_contents as $language_abbreviation) { if ($language_abbreviation == '.' || $language_abbreviation == '..') { continue; } // adjust language xml file to include all xml phrase files in the vm folder