diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-01-08 13:40:47 +0300 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-01-08 13:40:47 +0300 |
commit | aca2807da647d89beb0254bd92e4aae6c9c2662f (patch) | |
tree | d1ab713031b012a8c11af4050db5b5f2f5008a37 /apps | |
parent | 441cdccc3ecab5255875d35d573d430400cb312d (diff) |
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.php | 4 |
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 04e6f4d626a..b2a2e4813df 100644 --- a/apps/files_sharing/lib/share/file.php +++ b/apps/files_sharing/lib/share/file.php @@ -157,7 +157,9 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent { $folder = substr($target, 0, $pos); $source = \OCP\Share::getItemSharedWith('folder', $folder, \OC_Share_Backend_File::FORMAT_SHARED_STORAGE); if ($source) { - $source['path'] = $source['path'].substr($target, strlen($folder)); + // 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'] . substr($target, strlen($folder)), '/'); } } else { $source = \OCP\Share::getItemSharedWith('file', $target, \OC_Share_Backend_File::FORMAT_SHARED_STORAGE); |