aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/share.php
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2013-08-17 18:45:36 +0200
committerArthur Schiwon <blizzz@owncloud.com>2013-08-22 00:00:40 +0200
commit958130e8fef633cf7ee0bdca771bbb9205e337d7 (patch)
tree4d7212cf8f72c586e77732a1c92dc3771b613b82 /lib/public/share.php
parentc482512e23c2411244492b3b29ba6a6f6923c504 (diff)
downloadnextcloud-server-958130e8fef633cf7ee0bdca771bbb9205e337d7.tar.gz
nextcloud-server-958130e8fef633cf7ee0bdca771bbb9205e337d7.zip
Sharing: only determine path root if owner is available
Diffstat (limited to 'lib/public/share.php')
-rw-r--r--lib/public/share.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/public/share.php b/lib/public/share.php
index 63645e6fa34..b38208bc67f 100644
--- a/lib/public/share.php
+++ b/lib/public/share.php
@@ -209,7 +209,7 @@ class Share {
}
}
}
-
+
// let's get the parent for the next round
$meta = $cache->get((int)$source);
if($meta !== false) {
@@ -840,7 +840,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';
@@ -1303,11 +1307,11 @@ class Share {
'run' => &$run,
'error' => &$error
));
-
+
if ($run === false) {
throw new \Exception($error);
}
-
+
if (isset($fileSource)) {
if ($parentFolder) {
if ($parentFolder === true) {
@@ -1398,11 +1402,11 @@ class Share {
'run' => &$run,
'error' => &$error
));
-
+
if ($run === false) {
throw new \Exception($error);
}
-
+
if (isset($fileSource)) {
if ($parentFolder) {
if ($parentFolder === true) {