Merge pull request #31976 from nextcloud/backport/31886/stable23

[stable23] Principal search by display name case insensitive
This commit is contained in:
blizzz 2022-05-16 12:20:05 +02:00 committed by GitHub
commit 64a912ea7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 = [];