Skip to content

Commit

Permalink
Fix out-of-bound array access (IMAP)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
BjoKaSH committed May 18, 2023
1 parent 9090251 commit 1e4d5ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/IMAP.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function checkPassword($uid, $password) {
}

$groups = [];
if ($this->groupDomain && $pieces[1]) {
if ((count($pieces) > 1) && $this->groupDomain && $pieces[1]) {
$groups[] = $pieces[1];
}

Expand Down

0 comments on commit 1e4d5ce

Please sign in to comment.