Check variable is of type array before using it

For PHP 7.4
This commit is contained in:
Tsvetan Koshutanski 2021-03-25 17:22:05 +02:00 committed by Fedor A. Fetisov
parent 026b463fb7
commit f28659a025

View File

@ -76,6 +76,10 @@ function group_by_name($name)
*/ */
function get_group_name($group) function get_group_name($group)
{ {
if (!is_array($group)) {
return null;
}
$use_local_name = (get_home_locale() == get_current_locale()) $use_local_name = (get_home_locale() == get_current_locale())
|| !isset($group['vccommonname']) || !isset($group['vccommonname'])
|| !$group['vccommonname']; || !$group['vccommonname'];