Skip to content

Commit

Permalink
Merge pull request #31886 from nextcloud/bugfix/noid/principal-search…
Browse files Browse the repository at this point in the history
…-case-insensitive-dn

Principal search by display name case insensitive
  • Loading branch information
PVince81 authored Apr 14, 2022
2 parents 3ca7971 + 1bac5e2 commit 0824f44
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apps/dav/lib/Connector/Sabre/Principal.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down

0 comments on commit 0824f44

Please sign in to comment.