Skip to content

Commit e5efb68

Browse files
PVince81artonge
authored andcommitted
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 <[email protected]>
1 parent e501c2e commit e5efb68

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

apps/dav/lib/Connector/Sabre/Principal.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,10 @@ protected function searchUserPrincipals(array $searchProperties, $test = 'allof'
342342

343343
if (!$allowEnumeration) {
344344
if ($allowEnumerationFullMatch) {
345+
$lowerSearch = strtolower($value);
345346
$users = $this->userManager->searchDisplayName($value, $searchLimit);
346-
$users = \array_filter($users, static function (IUser $user) use ($value) {
347-
return $user->getDisplayName() === $value;
347+
$users = \array_filter($users, static function (IUser $user) use ($lowerSearch) {
348+
return strtolower($user->getDisplayName()) === $lowerSearch;
348349
});
349350
} else {
350351
$users = [];

0 commit comments

Comments
 (0)