aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/public.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/public.php')
-rw-r--r--apps/files_sharing/public.php18
1 files changed, 2 insertions, 16 deletions
diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php
index fb18bc26248..7c9158d8002 100644
--- a/apps/files_sharing/public.php
+++ b/apps/files_sharing/public.php
@@ -27,23 +27,9 @@ if (isset($_GET['t'])) {
$type = $linkItem['item_type'];
$fileSource = $linkItem['file_source'];
$shareOwner = $linkItem['uid_owner'];
- $fileOwner = null;
$path = null;
- if (isset($linkItem['parent'])) {
- $parent = $linkItem['parent'];
- while (isset($parent)) {
- $query = \OC_DB::prepare('SELECT `parent`, `uid_owner` FROM `*PREFIX*share` WHERE `id` = ?', 1);
- $item = $query->execute(array($parent))->fetchRow();
- if (isset($item['parent'])) {
- $parent = $item['parent'];
- } else {
- $fileOwner = $item['uid_owner'];
- break;
- }
- }
- } else {
- $fileOwner = $shareOwner;
- }
+ $rootLinkItem = OCP\Share::resolveReShare($linkItem);
+ $fileOwner = $rootLinkItem['uid_owner'];
if (isset($fileOwner)) {
OC_Util::tearDownFS();
OC_Util::setupFS($fileOwner);