From 1bac5e2cbe17a3f7accb203a5baf4f8809ceef16 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 8002f96379880..c3f06f95783a0 100644 --- a/apps/dav/lib/Connector/Sabre/Principal.php +++ b/apps/dav/lib/Connector/Sabre/Principal.php @@ -347,9 +347,10 @@ protected function searchUserPrincipals(array $searchProperties, $test = 'allof' 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 = [];