summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2012-06-24 16:42:51 -0400
committerBart Visscher <bartv@thisnet.nl>2012-06-27 01:05:36 +0200
commit819811461535cceb8208651f6a131cbb97efd169 (patch)
tree4e0399b9d8b4813a34fe264de3c3835bf87ebe0e /apps/files_sharing
parent5f1aa1b92e7b8e18e38718b8da6c79eda0840ac1 (diff)
downloadnextcloud-server-819811461535cceb8208651f6a131cbb97efd169.tar.gz
nextcloud-server-819811461535cceb8208651f6a131cbb97efd169.zip
Some more changes to getItems() and fixes in shared storage
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/sharedstorage.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/apps/files_sharing/sharedstorage.php b/apps/files_sharing/sharedstorage.php
index 21aa2f23b94..11a5d39f011 100644
--- a/apps/files_sharing/sharedstorage.php
+++ b/apps/files_sharing/sharedstorage.php
@@ -38,16 +38,23 @@ class OC_Filestorage_Shared extends OC_Filestorage_Common {
return $this->sourcePaths[$target];
} else {
if (dirname($target) != $this->sharedFolder) {
- $pos = strlen($this->sharedFolder);
+ $len = strlen($this->sharedFolder);
+ $pos = strpos($target, '/', $len);
// Get shared folder name
- $itemTarget = substr($target, $pos, strpos($target, '/', $pos));
+ $itemTarget = substr($target, $len, $pos);
+ $insideFolder = true;
} else {
$itemTarget = $target;
+ $insideFolder = false;
}
$sourcePath = OCP\Share::getItemSharedWith('file', $itemTarget, OC_Share_Backend_File::FORMAT_SOURCE_PATH);
if ($sourcePath) {
- $this->sourcePaths[$target] = $sourcePath;
- return $sourcePath;
+ if ($insideFolder) {
+ $this->sourcePaths[$target] = $sourcePath.substr($target, $pos);
+ } else {
+ $this->sourcePaths[$target] = $sourcePath;
+ }
+ return $this->sourcePaths[$target];
}
return false;
}