summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/lib/Cache.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/Cache.php b/apps/files_sharing/lib/Cache.php
index 25e92d23962..ab8adda725e 100644
--- a/apps/files_sharing/lib/Cache.php
+++ b/apps/files_sharing/lib/Cache.php
@@ -38,6 +38,7 @@ use OCP\Files\Search\ISearchBinaryOperator;
use OCP\Files\Search\ISearchComparison;
use OCP\Files\Search\ISearchOperator;
use OCP\Files\StorageNotAvailableException;
+use OCP\IUserManager;
/**
* Metadata cache for shared files
@@ -174,7 +175,13 @@ class Cache extends CacheJail {
private function getOwnerDisplayName() {
if (!$this->ownerDisplayName) {
- $this->ownerDisplayName = \OC_User::getDisplayName($this->storage->getOwner(''));
+ $uid = $this->storage->getOwner('');
+ $user = \OC::$server->get(IUserManager::class)->get($uid);
+ if ($user) {
+ $this->ownerDisplayName = $user->getDisplayName();
+ } else {
+ $this->ownerDisplayName = $uid;
+ }
}
return $this->ownerDisplayName;
}