summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-06-10 13:50:52 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2014-06-14 10:14:08 +0200
commitc61f759a8b4f0091a978eb4e8da1354809d77f5e (patch)
tree52d02f68c27d9cb151714a87590ba0470514372a /lib
parent790d51ea1efeb17c55870a5659a6f49e518d0ebe (diff)
downloadnextcloud-server-c61f759a8b4f0091a978eb4e8da1354809d77f5e.tar.gz
nextcloud-server-c61f759a8b4f0091a978eb4e8da1354809d77f5e.zip
Fix check for shared files inside shares
Diffstat (limited to 'lib')
-rw-r--r--lib/private/share/share.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/private/share/share.php b/lib/private/share/share.php
index 0a4d9a913e2..26108a937ce 100644
--- a/lib/private/share/share.php
+++ b/lib/private/share/share.php
@@ -508,9 +508,9 @@ class Share extends \OC\Share\Constants {
if ($itemType === 'folder') {
$path = '/' . $uidOwner . '/files' . \OC\Files\Filesystem::getPath($itemSource) . '/';
$mountManager = \OC\Files\Filesystem::getMountManager();
- $mounts = $mountManager->getAll();
- foreach ($mounts as $mountPoint => $mount) {
- if ($mount->getStorage() instanceof \OCA\Files_Sharing\ISharedStorage && strpos($mountPoint, $path) === 0) {
+ $mounts = $mountManager->findIn($path);
+ foreach ($mounts as $mount) {
+ if ($mount->getStorage()->instanceOfStorage('\OCA\Files_Sharing\ISharedStorage')) {
$message = 'Sharing "' . $itemSourceName . '" failed, because it contains files shared with you!';
\OC_Log::write('OCP\Share', $message, \OC_Log::ERROR);
throw new \Exception($message);