From c50e1c3654fad89c4eda8f7c7f9f446f64af6c71 Mon Sep 17 00:00:00 2001 From: Supercrafter100 <58982133+supercrafter100@users.noreply.github.com> Date: Tue, 28 Mar 2023 21:37:44 +0200 Subject: [PATCH] Fix recursive group add (#3288) --- core/classes/Core/User.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/classes/Core/User.php b/core/classes/Core/User.php index 886b91472f..0d2faef8c0 100644 --- a/core/classes/Core/User.php +++ b/core/classes/Core/User.php @@ -130,7 +130,7 @@ private function find(string $value, string $field = 'id'): bool { * @return bool True on success, false if they already have it. */ public function addGroup(int $group_id, int $expire = 0): bool { - if (array_key_exists($group_id, $this->getGroups())) { + if (array_key_exists($group_id, $this->_groups ?? [])) { return false; }