Fix source path when share is a mount point
Whenever an external storage mount point is shared directly, its path is empty which causes a leading slash to appear in the source path. This fix removes the bogus leading slash in such situation.
This commit is contained in:
parent
10505bdb0d
commit
01c83158bb
|
@ -213,7 +213,9 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent {
|
||||||
if ($itemType === 'folder') {
|
if ($itemType === 'folder') {
|
||||||
$source = \OCP\Share::getItemSharedWith('folder', $mountPoint, \OC_Share_Backend_File::FORMAT_SHARED_STORAGE);
|
$source = \OCP\Share::getItemSharedWith('folder', $mountPoint, \OC_Share_Backend_File::FORMAT_SHARED_STORAGE);
|
||||||
if ($source && $target !== '') {
|
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 {
|
} else {
|
||||||
$source = \OCP\Share::getItemSharedWith('file', $mountPoint, \OC_Share_Backend_File::FORMAT_SHARED_STORAGE);
|
$source = \OCP\Share::getItemSharedWith('file', $mountPoint, \OC_Share_Backend_File::FORMAT_SHARED_STORAGE);
|
||||||
|
|
Loading…
Reference in New Issue