]> source.dussan.org Git - nextcloud-server.git/commitdiff
Do not match sharees on an empty email address 23074/head
authorChristoph Wurst <christoph@winzerhof-wurst.at>
Mon, 28 Sep 2020 13:35:11 +0000 (15:35 +0200)
committerChristoph Wurst <christoph@winzerhof-wurst.at>
Mon, 28 Sep 2020 13:35:11 +0000 (15:35 +0200)
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>
lib/private/Collaboration/Collaborators/UserPlugin.php

index 13e914367d7319b35c8b37c38a40dc892219672f..2d21c6a16f75b97bf6dcb37ee3f88332fa52e8b3 100644 (file)
@@ -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;