[Pkg-owncloud-commits] [owncloud] 36/90: Fix source path when share is a mount point
David Prévot
taffit at moszumanska.debian.org
Fri Feb 6 21:10:46 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit a5574e885c0b69c7f0c343564e9fc218f4c6697d
Author: Vincent Petry <pvince81 at owncloud.com>
Date: Thu Jan 8 11:40:47 2015 +0100
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.
Backport of 01c83158bb997a68736ef3dd548bcbc96e9cca94 from master
---
apps/files_sharing/lib/share/file.php | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/apps/files_sharing/lib/share/file.php b/apps/files_sharing/lib/share/file.php
index a5b4e75..8df114c 100644
--- a/apps/files_sharing/lib/share/file.php
+++ b/apps/files_sharing/lib/share/file.php
@@ -199,7 +199,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);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list