From 2634f77741721a7c79747669031929facbb59c64 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Thu, 20 Jul 2017 11:24:52 +0200 Subject: [PATCH] fix preview for public links in case a user is already logged in on the same server from which the public link comes from, we need to setup the owners file system in order to show the preview Signed-off-by: Bjoern Schiessle --- apps/dav/appinfo/v1/publicwebdav.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/dav/appinfo/v1/publicwebdav.php b/apps/dav/appinfo/v1/publicwebdav.php index 3ef1c2e62a5..37fcebe605c 100644 --- a/apps/dav/appinfo/v1/publicwebdav.php +++ b/apps/dav/appinfo/v1/publicwebdav.php @@ -79,10 +79,12 @@ $server = $serverFactory->createServer($baseuri, $requestUri, $authPlugin, funct \OC\Files\Filesystem::addStorageWrapper('sharePermissions', function ($mountPoint, $storage) use ($share) { return new \OC\Files\Storage\Wrapper\PermissionsMask(array('storage' => $storage, 'mask' => $share->getPermissions() | \OCP\Constants::PERMISSION_SHARE)); }); + \OC\Files\Filesystem::logWarningWhenAddingStorageWrapper($previousLog); + OC_Util::tearDownFS(); OC_Util::setupFS($owner); - $ownerView = \OC\Files\Filesystem::getView(); + $ownerView = new \OC\Files\View('/'. $owner . '/files'); $path = $ownerView->getPath($fileId); $fileInfo = $ownerView->getFileInfo($path); $linkCheckPlugin->setFileInfo($fileInfo); -- 2.39.5