summaryrefslogtreecommitdiffstats
path: root/lib/private/Preview
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2016-11-24 13:20:51 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2016-11-24 13:20:51 +0100
commitdab87ef6fd6e20110b6c869af54f4e146fb95e36 (patch)
tree3b3dcf4728c3ed5d32ff952a25de96e6485ccaa2 /lib/private/Preview
parentf4cf125a4a9e43478dc4def3308cdd2f72c91321 (diff)
downloadnextcloud-server-dab87ef6fd6e20110b6c869af54f4e146fb95e36.tar.gz
nextcloud-server-dab87ef6fd6e20110b6c869af54f4e146fb95e36.zip
Fix previews for federated shares
The owner of a federated file is the federated user. For which we obviously can't setup a view. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/Preview')
-rw-r--r--lib/private/Preview/GeneratorHelper.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/private/Preview/GeneratorHelper.php b/lib/private/Preview/GeneratorHelper.php
index 282c46a2a5d..6535fde058b 100644
--- a/lib/private/Preview/GeneratorHelper.php
+++ b/lib/private/Preview/GeneratorHelper.php
@@ -60,7 +60,8 @@ class GeneratorHelper {
* This is required to create the old view and path
*/
private function getViewAndPath(File $file) {
- $owner = $file->getOwner()->getUID();
+ $absPath = ltrim($file->getPath(), '/');
+ $owner = explode('/', $absPath)[0];
$userFolder = $this->rootFolder->getUserFolder($owner)->getParent();