Also apply #2192 fix to document and comment modules; defend null

This commit is contained in:
Kijin Sung 2023-10-03 14:32:15 +09:00
parent ce3f5e98d2
commit 433103bf92
3 changed files with 7 additions and 10 deletions

View file

@ -119,12 +119,10 @@ class CommentModel extends Comment
}
// Changing a language of pop-up menu
$menus = Context::get('comment_popup_menu_list');
$menus_count = count($menus);
for($i = 0; $i < $menus_count; $i++)
$menus = Context::get('comment_popup_menu_list') ?: [];
foreach ($menus as $menu)
{
$menus[$i]->str = lang($menus[$i]->str);
$menu->str = lang($menu->str ?? '');
}
// get a list of final organized pop-up menus