From 0aa70b3d889418afa2192865ea191d461dd3cc87 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Fri, 8 Apr 2022 10:20:24 +0200 Subject: [PATCH] Principal search by display name case insensitive Adjust principal search to be case insensitive even with exact match. This aligns the behavior to how the search also works in Collaborators/UserPlugin Signed-off-by: Vincent Petry --- apps/dav/lib/Connector/Sabre/Principal.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/dav/lib/Connector/Sabre/Principal.php b/apps/dav/lib/Connector/Sabre/Principal.php index 8002f963798..c3f06f95783 100644 --- a/apps/dav/lib/Connector/Sabre/Principal.php +++ b/apps/dav/lib/Connector/Sabre/Principal.php @@ -347,9 +347,10 @@ class Principal implements BackendInterface { if (!$allowEnumeration) { if ($allowEnumerationFullMatch) { + $lowerSearch = strtolower($value); $users = $this->userManager->searchDisplayName($value, $searchLimit); - $users = \array_filter($users, static function (IUser $user) use ($value) { - return $user->getDisplayName() === $value; + $users = \array_filter($users, static function (IUser $user) use ($lowerSearch) { + return strtolower($user->getDisplayName()) === $lowerSearch; }); } else { $users = []; -- 2.39.5