From ce10b93519a8f11affa906b526b508e790e5b4a7 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 2 Dec 2014 15:28:11 +0100 Subject: [PATCH] Dont return cached date in shared cache when the file doesn't exist --- apps/files_sharing/lib/cache.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/apps/files_sharing/lib/cache.php b/apps/files_sharing/lib/cache.php index 270ed704bb..e09b64cb03 100644 --- a/apps/files_sharing/lib/cache.php +++ b/apps/files_sharing/lib/cache.php @@ -89,16 +89,18 @@ class Shared_Cache extends Cache { $cache = $this->getSourceCache($file); if ($cache) { $data = $cache->get($this->files[$file]); - $data['displayname_owner'] = \OC_User::getDisplayName($this->storage->getSharedFrom()); - $data['path'] = $file; - if ($file === '') { - $data['is_share_mount_point'] = true; - } - $data['uid_owner'] = $this->storage->getOwner($file); - if (isset($data['permissions'])) { - $data['permissions'] &= $this->storage->getPermissions($file); - } else { - $data['permissions'] = $this->storage->getPermissions($file); + if ($data) { + $data['displayname_owner'] = \OC_User::getDisplayName($this->storage->getSharedFrom()); + $data['path'] = $file; + if ($file === '') { + $data['is_share_mount_point'] = true; + } + $data['uid_owner'] = $this->storage->getOwner($file); + if (isset($data['permissions'])) { + $data['permissions'] &= $this->storage->getPermissions($file); + } else { + $data['permissions'] = $this->storage->getPermissions($file); + } } return $data; }