]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix getting file info for subfolders in shared folders
authorMichael Gapczynski <mtgap@owncloud.com>
Mon, 8 Oct 2012 20:05:48 +0000 (16:05 -0400)
committerMichael Gapczynski <mtgap@owncloud.com>
Mon, 8 Oct 2012 20:05:57 +0000 (16:05 -0400)
lib/files.php

index ac999a9bd156b5d010b078e6e4d4c261c04e69e8..ad716115dc7b6091ca39338af8718b9f4a3d024d 100644 (file)
@@ -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];
                }