diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2012-10-08 16:05:48 -0400 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2012-10-08 16:05:57 -0400 |
commit | 33d1906f23155cd3656977f38da27e1e77ae17a3 (patch) | |
tree | 71e2085fab1afa31f2fdcdc84b139dfb1ce3701f /lib/files.php | |
parent | 71ff6382b57a51f2428b5205907248a9fbdea8ec (diff) | |
download | nextcloud-server-33d1906f23155cd3656977f38da27e1e77ae17a3.tar.gz nextcloud-server-33d1906f23155cd3656977f38da27e1e77ae17a3.zip |
Fix getting file info for subfolders in shared folders
Diffstat (limited to 'lib/files.php')
-rw-r--r-- | lib/files.php | 10 |
1 files 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]; } |