]> source.dussan.org Git - nextcloud-server.git/commitdiff
Sharing: only determine path root if owner is available
authorArthur Schiwon <blizzz@owncloud.com>
Sat, 17 Aug 2013 16:45:36 +0000 (18:45 +0200)
committerArthur Schiwon <blizzz@owncloud.com>
Sat, 17 Aug 2013 16:45:36 +0000 (18:45 +0200)
lib/public/share.php

index 37931932a5f6fe67e771b60bf63ce5d4600e63e2..cae0e3bdc041b3f05065b4f50b1d91ad28af3f88 100644 (file)
@@ -210,7 +210,7 @@ class Share {
                                        }
                                }
                        }
-                       
+
                        // let's get the parent for the next round
                        $meta = $cache->get((int)$source);
                        if($meta !== false) {
@@ -841,7 +841,11 @@ class Share {
                // Get filesystem root to add it to the file target and remove from the
                // file source, match file_source with the file cache
                if ($itemType == 'file' || $itemType == 'folder') {
-                       $root = \OC\Files\Filesystem::getRoot();
+                       if(!is_null($uidOwner)) {
+                               $root = \OC\Files\Filesystem::getRoot();
+                       } else {
+                               $root = '';
+                       }
                        $where = 'INNER JOIN `*PREFIX*filecache` ON `file_source` = `*PREFIX*filecache`.`fileid`';
                        if (!isset($item)) {
                                $where .= ' WHERE `file_target` IS NOT NULL';
@@ -1300,11 +1304,11 @@ class Share {
                                'run' => &$run,
                                'error' => &$error
                        ));
-                       
+
                        if ($run === false) {
                                throw new \Exception($error);
                        }
-                       
+
                        if (isset($fileSource)) {
                                if ($parentFolder) {
                                        if ($parentFolder === true) {
@@ -1394,11 +1398,11 @@ class Share {
                                'run' => &$run,
                                'error' => &$error
                        ));
-                       
+
                        if ($run === false) {
                                throw new \Exception($error);
                        }
-                       
+
                        if (isset($fileSource)) {
                                if ($parentFolder) {
                                        if ($parentFolder === true) {