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 <mls@bjoern-kahl.de>
This commit is contained in:
Bjoern Kahl
2023-05-18 14:28:08 +00:00
parent 455726df6a
commit 8fd2a5d06a

View File

@@ -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];
}