[Pkg-owncloud-commits] [owncloud] 03/14: Fix source path when share is a mount point
David Prévot
taffit at moszumanska.debian.org
Wed Mar 11 15:49:32 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to annotated tag v6.0.7
in repository owncloud.
commit aca2807da647d89beb0254bd92e4aae6c9c2662f
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.
---
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 04e6f4d..b2a2e48 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);
--
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