From 33d1906f23155cd3656977f38da27e1e77ae17a3 Mon Sep 17 00:00:00 2001 From: Michael Gapczynski Date: Mon, 8 Oct 2012 16:05:48 -0400 Subject: [PATCH] Fix getting file info for subfolders in shared folders --- lib/files.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/files.php b/lib/files.php index ac999a9bd15..ad716115dc7 100644 --- a/lib/files.php +++ b/lib/files.php @@ -47,8 +47,14 @@ class OC_Files { $info = OCP\Share::getItemsSharedWith('file', OC_Share_Backend_File::FORMAT_FILE_APP_ROOT); } else { - $path = substr($path, 7); - $info = OCP\Share::getItemSharedWith('file', $path, OC_Share_Backend_File::FORMAT_FILE_APP); + $pos = strpos($path, '/', 8); + // Get shared folder name + if ($pos !== false) { + $itemTarget = substr($path, 7, $pos - 7); + } else { + $itemTarget = substr($path, 7); + } + $info = OCP\Share::getItemSharedWith('file', $itemTarget, OC_Share_Backend_File::FORMAT_FILE_APP, array('folder' => $path)); } $info = $info[0]; } -- 2.39.5