Fix PHP8.0 (TypeError): explode(): Argument #2 ($string) must be of type string, array given

This commit is contained in:
Hadi Nategh 2021-11-04 14:30:23 +01:00
parent 5227425671
commit fd3b61b6af

View File

@ -996,7 +996,7 @@ abstract class Ajax extends Api\Framework
{
$open_tabs = $GLOBALS['egw_info']['user']['preferences']['common']['open_tabs'];
}
$open_tabs = $open_tabs ? explode(',',$open_tabs) : array();
$open_tabs = $open_tabs && is_string($open_tabs) ? explode(',',$open_tabs) : (array)$open_tabs;
if ($active_tab && !in_array($active_tab,$open_tabs))
{
$open_tabs[] = $active_tab;