From 8f135b13e502883737be772a6150a35d5a00c73b Mon Sep 17 00:00:00 2001 From: ralf Date: Thu, 6 Mar 2025 08:42:27 +0100 Subject: [PATCH] fix PHP TypeError array_search(): Argument #2 ($haystack) must be of type array, int given --- api/src/Accounts/Sql.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/Accounts/Sql.php b/api/src/Accounts/Sql.php index 22580a4c59..1da3c11bf6 100644 --- a/api/src/Accounts/Sql.php +++ b/api/src/Accounts/Sql.php @@ -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'])