[Pkg-owncloud-commits] [owncloud] 08/85: Fix sharing of ext storage mount points

David Prévot taffit at moszumanska.debian.org
Tue Jun 17 19:12:40 UTC 2014


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

taffit pushed a commit to branch 6.0
in repository owncloud.

commit 113cd404c096a1a747df6d3c4acbd4a115af6fd8
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Wed May 7 18:23:00 2014 +0200

    Fix sharing of ext storage mount points
    
    When sharing an ext storage mount point, it will now use the name of the
    mount point instead of an empty string for the target path.
    
    Backport of 28f0e63 from master
---
 apps/files_sharing/lib/share/file.php | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/apps/files_sharing/lib/share/file.php b/apps/files_sharing/lib/share/file.php
index ec0f368..04e6f4d 100644
--- a/apps/files_sharing/lib/share/file.php
+++ b/apps/files_sharing/lib/share/file.php
@@ -31,10 +31,12 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent {
 	private $path;
 
 	public function isValidSource($itemSource, $uidOwner) {
-		$query = \OC_DB::prepare('SELECT `name` FROM `*PREFIX*filecache` WHERE `fileid` = ?');
-		$result = $query->execute(array($itemSource));
-		if ($row = $result->fetchRow()) {
-			$this->path = $row['name'];
+		$path = \OC\Files\Filesystem::getPath($itemSource);
+		if ($path) {
+			// FIXME: attributes should not be set here,
+			// keeping this pattern for now to avoid unexpected
+			// regressions
+			$this->path = basename($path);
 			return true;
 		}
 		return false;

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