diff --git a/apps/user_ldap/lib/Group_LDAP.php b/apps/user_ldap/lib/Group_LDAP.php index 376af8520d040..699205cf501b5 100644 --- a/apps/user_ldap/lib/Group_LDAP.php +++ b/apps/user_ldap/lib/Group_LDAP.php @@ -685,7 +685,7 @@ private function isUserOnLDAP(string $uid): bool { protected function getCachedGroupsForUserId(string $uid): array { $groupStr = $this->config->getUserValue($uid, 'user_ldap', 'cached-group-memberships-' . $this->access->connection->getConfigPrefix(), '[]'); - return json_decode($groupStr) ?? []; + return json_decode($groupStr, true) ?? []; } /** @@ -838,7 +838,7 @@ public function getUserGroups($uid): array { return $groups; } - $groups = array_unique($groups, SORT_LOCALE_STRING); + $groups = array_values(array_unique($groups, SORT_LOCALE_STRING)); $this->access->connection->writeToCache($cacheKey, $groups); $groupStr = \json_encode($groups);