Fix PHP 8 error: "array_search(): Argument #2 ($haystack) must be of type array, null given"

This commit is contained in:
nathan 2021-10-14 08:55:36 -06:00
parent 2ec9e27671
commit c8843f88c9

View File

@ -126,7 +126,10 @@ class importexport_definitions_bo {
$definition = $this->read($key);
if($definition['owner'] && $definition['owner'] == $GLOBALS['egw_info']['user']['account_id'] || $GLOBALS['egw_info']['user']['apps']['admin']) {
// clear private cache
if(is_array($this->definitions))
{
unset($this->definitions[array_search($key, $this->definitions)]);
}
} else {
unset($keys[$index]);
}