Prevent a warning by using isset

This commit is contained in:
FusionPBX 2024-05-02 14:05:30 -06:00 committed by GitHub
parent 55bebdec6d
commit 85e439fdbf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -100,12 +100,16 @@ class text {
if (is_array($text)) {
foreach ($text as $key => $value) {
if (isset($value[$language_code]) && !empty($value[$language_code])) {
//use the selected language
$text[$key] = $value[$language_code];
}
else {
elseif (isset($value['en-us'])) {
//fallback to en-us
$text[$key] = $value['en-us'];
}
else {
$text[$key] = '';
}
}
}
}