[Pkg-owncloud-commits] [owncloud] 121/223: Fix check for shared files inside shares

David Prévot taffit at moszumanska.debian.org
Sun Jun 22 01:54:14 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit c61f759a8b4f0091a978eb4e8da1354809d77f5e
Author: Robin Appelman <icewind at owncloud.com>
Date:   Tue Jun 10 13:50:52 2014 +0200

    Fix check for shared files inside shares
---
 apps/files_sharing/lib/sharedstorage.php | 3 ++-
 lib/private/share/share.php              | 6 +++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php
index 59de2df..6760538 100644
--- a/apps/files_sharing/lib/sharedstorage.php
+++ b/apps/files_sharing/lib/sharedstorage.php
@@ -23,12 +23,13 @@
 
 namespace OC\Files\Storage;
 use OC\Files\Filesystem;
+use OCA\Files_Sharing\ISharedStorage;
 use OCA\Files_Sharing\SharedMount;
 
 /**
  * Convert target path to source path and pass the function call to the correct storage provider
  */
-class Shared extends \OC\Files\Storage\Common {
+class Shared extends \OC\Files\Storage\Common implements ISharedStorage {
 
 	private $share;   // the shared resource
 	private $files = array();
diff --git a/lib/private/share/share.php b/lib/private/share/share.php
index 0a4d9a9..26108a9 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);

-- 
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