From 008b79d808b7d5f42c0e6072e021ac8fde72d3aa Mon Sep 17 00:00:00 2001 From: Côme Chilliet Date: Thu, 21 Oct 2021 16:58:59 +0200 Subject: Fix type errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- lib/private/Collaboration/Collaborators/UserPlugin.php | 2 +- lib/private/User/Database.php | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/private/Collaboration/Collaborators/UserPlugin.php b/lib/private/Collaboration/Collaborators/UserPlugin.php index 9ed94082f0d..1c00bb26c94 100644 --- a/lib/private/Collaboration/Collaborators/UserPlugin.php +++ b/lib/private/Collaboration/Collaborators/UserPlugin.php @@ -178,7 +178,7 @@ class UserPlugin implements ISearchPlugin { $this->shareeEnumerationFullMatch && $lowerSearch !== '' && (strtolower($uid) === $lowerSearch || strtolower($userDisplayName) === $lowerSearch || - strtolower($userEmail) === $lowerSearch) + strtolower($userEmail ?? '') === $lowerSearch) ) { if (strtolower($uid) === $lowerSearch) { $foundUserById = true; diff --git a/lib/private/User/Database.php b/lib/private/User/Database.php index 5dfc74163a7..81094d4d8af 100644 --- a/lib/private/User/Database.php +++ b/lib/private/User/Database.php @@ -386,13 +386,14 @@ class Database extends ABackend implements $row = $result->fetch(); $result->closeCursor(); - $this->cache[$uid] = false; - // "uid" is primary key, so there can only be a single result if ($row !== false) { - $this->cache[$uid]['uid'] = (string)$row['uid']; - $this->cache[$uid]['displayname'] = (string)$row['displayname']; + $this->cache[$uid] = [ + 'uid' => (string)$row['uid'], + 'displayname' => (string)$row['displayname'], + ]; } else { + $this->cache[$uid] = false; return false; } } -- cgit v1.2.3