mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 00:32:29 -04:00
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 <vincent@nextcloud.com>
This commit is contained in:
parent
e2f137c2db
commit
0aa70b3d88
1 changed files with 3 additions and 2 deletions
|
|
@ -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 = [];
|
||||
|
|
|
|||
Loading…
Reference in a new issue