From 8fd2a5d06af7ddd6dfafde749a5b4128a533048d Mon Sep 17 00:00:00 2001 From: Bjoern Kahl Date: Thu, 18 May 2023 14:28:08 +0000 Subject: [PATCH] Fix out-of-bound array access (IMAP) The IMAP method allows user names with or without a domain part. For user names without a domain part, it still tries to access the (then non-existing) domain, resulting in "Error: Undefined array key 1 at .../nextcloud/apps/user_external/lib/IMAP.php#85" log messages. Signed-off-by: Bjoern Kahl --- lib/IMAP.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/IMAP.php b/lib/IMAP.php index cd5e8ec..328ec23 100644 --- a/lib/IMAP.php +++ b/lib/IMAP.php @@ -82,7 +82,7 @@ class IMAP extends Base { } $groups = []; - if ($this->groupDomain && $pieces[1]) { + if ((count($pieces) > 1) && $this->groupDomain && $pieces[1]) { $groups[] = $pieces[1]; }