Merge pull request #13170 from owncloud/extstorage-fixsharedmountpointrootleadingslash

Fix source path when share is a mount point
This commit is contained in:
Thomas Müller 2015-01-08 15:02:16 +01:00
commit 6b0ae34de6
1 changed files with 3 additions and 1 deletions

View File

@ -213,7 +213,9 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent {
if ($itemType === 'folder') {
$source = \OCP\Share::getItemSharedWith('folder', $mountPoint, \OC_Share_Backend_File::FORMAT_SHARED_STORAGE);
if ($source && $target !== '') {
$source['path'] = $source['path'].'/'.$target;
// note: in case of ext storage mount points the path might be empty
// which would cause a leading slash to appear
$source['path'] = ltrim($source['path'] . '/' . $target, '/');
}
} else {
$source = \OCP\Share::getItemSharedWith('file', $mountPoint, \OC_Share_Backend_File::FORMAT_SHARED_STORAGE);