Prevent PHP 8.1 errrors

This commit is contained in:
FusionPBX 2023-07-06 12:25:47 -06:00 committed by GitHub
parent 890321e338
commit b7e3d6133c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 6 deletions

View File

@ -76,18 +76,19 @@
//add a function to return the action_name
function action_name($destination_array, $detail_action) {
$result = '';
if (!empty($destination_array)) {
foreach($destination_array as $group => $row) {
if (!empty($row)) {
foreach ($row as $key => $value) {
if ($value == $detail_action) {
//add multi-lingual support
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/".$group."/app_languages.php")) {
$language2 = new text;
$text2 = $language2->get($_SESSION['domain']['language']['code'], 'app/'.$group);
}
//return the group and destination name
return trim($text2['title-'.$group].' '.$key);
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/".$group."/app_languages.php")) {
$language2 = new text;
$text2 = $language2->get($_SESSION['domain']['language']['code'], 'app/'.$group);
$result = trim($text2['title-'.$group].' '.$key);
}
return $result;
}
}
}