Sharing: only determine path root if owner is available
This commit is contained in:
parent
c482512e23
commit
958130e8fe
|
@ -209,7 +209,7 @@ class Share {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// let's get the parent for the next round
|
// let's get the parent for the next round
|
||||||
$meta = $cache->get((int)$source);
|
$meta = $cache->get((int)$source);
|
||||||
if($meta !== false) {
|
if($meta !== false) {
|
||||||
|
@ -840,7 +840,11 @@ class Share {
|
||||||
// Get filesystem root to add it to the file target and remove from the
|
// Get filesystem root to add it to the file target and remove from the
|
||||||
// file source, match file_source with the file cache
|
// file source, match file_source with the file cache
|
||||||
if ($itemType == 'file' || $itemType == 'folder') {
|
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`';
|
$where = 'INNER JOIN `*PREFIX*filecache` ON `file_source` = `*PREFIX*filecache`.`fileid`';
|
||||||
if (!isset($item)) {
|
if (!isset($item)) {
|
||||||
$where .= ' WHERE `file_target` IS NOT NULL';
|
$where .= ' WHERE `file_target` IS NOT NULL';
|
||||||
|
@ -1303,11 +1307,11 @@ class Share {
|
||||||
'run' => &$run,
|
'run' => &$run,
|
||||||
'error' => &$error
|
'error' => &$error
|
||||||
));
|
));
|
||||||
|
|
||||||
if ($run === false) {
|
if ($run === false) {
|
||||||
throw new \Exception($error);
|
throw new \Exception($error);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($fileSource)) {
|
if (isset($fileSource)) {
|
||||||
if ($parentFolder) {
|
if ($parentFolder) {
|
||||||
if ($parentFolder === true) {
|
if ($parentFolder === true) {
|
||||||
|
@ -1398,11 +1402,11 @@ class Share {
|
||||||
'run' => &$run,
|
'run' => &$run,
|
||||||
'error' => &$error
|
'error' => &$error
|
||||||
));
|
));
|
||||||
|
|
||||||
if ($run === false) {
|
if ($run === false) {
|
||||||
throw new \Exception($error);
|
throw new \Exception($error);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($fileSource)) {
|
if (isset($fileSource)) {
|
||||||
if ($parentFolder) {
|
if ($parentFolder) {
|
||||||
if ($parentFolder === true) {
|
if ($parentFolder === true) {
|
||||||
|
|
Loading…
Reference in New Issue