Fix PHP 8.1 errors

This commit is contained in:
FusionPBX
2023-06-05 12:39:00 -06:00
committed by GitHub
parent a0dc490838
commit 791be82f27

View File

@@ -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