Sharing: only determine path root if owner is available

This commit is contained in:
Arthur Schiwon 2013-08-17 18:45:36 +02:00
parent c482512e23
commit 958130e8fe
1 changed files with 10 additions and 6 deletions

View File

@ -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') {
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';