fix PHP 8.0 error: array_intersect(): Argument #2 must be of type array, string given

This commit is contained in:
Ralf Becker 2021-10-25 16:04:28 +02:00
parent 6a3df9355c
commit 723db2c004

View File

@ -608,7 +608,10 @@ class infolog_ui
} }
if(count($links)) if(count($links))
{ {
$query['col_filter']['info_id'] = count($links) > 1 ? call_user_func_array('array_intersect', array_values($links)) : $links[$key ?? 'info_id']; $query['col_filter']['info_id'] = count($links) > 1 ? array_intersect(...array_map(static function($ids)
{
return (array)$ids;
}, array_values($links))) : $links[$key ?? 'info_id'];
} }
return $linked; return $linked;
} }