diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-09-28 15:35:11 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-09-28 15:35:11 +0200 |
commit | bbd962043b57a9bcb05bbefa7d273e45c88a5857 (patch) | |
tree | 4e911e6a59052268834e575a2eff1c117d1d6a54 | |
parent | bd0b28d670057bc8982560e1fb994fe3ed299d7a (diff) | |
download | nextcloud-server-bbd962043b57a9bcb05bbefa7d273e45c88a5857.tar.gz nextcloud-server-bbd962043b57a9bcb05bbefa7d273e45c88a5857.zip |
Do not match sharees on an empty email address
When asking for sharees we compare not only UID and displayname but also
the email address. And if that matches we return the sharee as an exact
match. This logic had a flaw as in that it also matched the empty string
to users with no email address.
This is most noticeable when you disable sharee enumeration and open the
ownership transfer dialog. It suggested other users of the instance
before. This has stopped now.
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
-rw-r--r-- | lib/private/Collaboration/Collaborators/UserPlugin.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/Collaboration/Collaborators/UserPlugin.php b/lib/private/Collaboration/Collaborators/UserPlugin.php index 13e914367d7..2d21c6a16f7 100644 --- a/lib/private/Collaboration/Collaborators/UserPlugin.php +++ b/lib/private/Collaboration/Collaborators/UserPlugin.php @@ -147,9 +147,9 @@ class UserPlugin implements ISearchPlugin { if ( - strtolower($uid) === $lowerSearch || + $lowerSearch !== '' && (strtolower($uid) === $lowerSearch || strtolower($userDisplayName) === $lowerSearch || - strtolower($userEmail) === $lowerSearch + strtolower($userEmail) === $lowerSearch) ) { if (strtolower($uid) === $lowerSearch) { $foundUserById = true; |