fix PHP TypeError array_search(): Argument #2 ($haystack) must be of type array, int given

This commit is contained in:
ralf 2025-03-06 08:42:27 +01:00
parent 1c8dfb7b2d
commit 8f135b13e5

View File

@ -468,10 +468,10 @@ class Sql
$filter = [];
// implement negated account_id filter used for hidden accounts/groups
if (!empty($param['account_id']) && ($not_account_ids = array_search('!', $param['account_id'])) !== false)
if (!empty($param['account_id']) && is_array($param['account_id']) && ($not_account_ids = array_search('!', $param['account_id'])) !== false)
{
unset($param['account_id'][$not_account_ids]);
$filter[] = $this->db->expression(self::TABLE, 'NOT ('.self::TABLE.'.', ['account_id' => array_map('abs', (array)$param['account_id'])], ')');
$filter[] = $this->db->expression(self::TABLE, 'NOT ('.self::TABLE.'.', ['account_id' => array_map('abs', $param['account_id'])], ')');
unset($param['account_id']);
}
switch($param['type'])