Fix type errors

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2021-10-21 16:58:59 +02:00
parent 3a1b3745eb
commit 008b79d808
No known key found for this signature in database
GPG key ID: A3E2F658B28C760A
2 changed files with 6 additions and 5 deletions

View file

@ -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;

View file

@ -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;
}
}