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 1f28336702
commit 62fcc3156c

View File

@ -998,7 +998,7 @@ abstract class Ajax extends Api\Framework
{ {
$open_tabs = $GLOBALS['egw_info']['user']['preferences']['common']['open_tabs']; $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)) if ($active_tab && !in_array($active_tab,$open_tabs))
{ {
$open_tabs[] = $active_tab; $open_tabs[] = $active_tab;