summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-01-08 11:40:47 +0100
committerVincent Petry <pvince81@owncloud.com>2015-01-08 11:46:11 +0100
commit01c83158bb997a68736ef3dd548bcbc96e9cca94 (patch)
treef1d0a6c0a96e0e973d02d9fc87bec4dbd8591a56 /apps
parent10505bdb0db4d14ce86815b57d2bca2ef880a581 (diff)
downloadnextcloud-server-01c83158bb997a68736ef3dd548bcbc96e9cca94.tar.gz
nextcloud-server-01c83158bb997a68736ef3dd548bcbc96e9cca94.zip
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.
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/lib/share/file.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/share/file.php b/apps/files_sharing/lib/share/file.php
index 93e4af3c393..1d7eb77f7cf 100644
--- a/apps/files_sharing/lib/share/file.php
+++ b/apps/files_sharing/lib/share/file.php
@@ -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);