From 28f0e6307fe2b2566108c22edd1c6b1caf0625c8 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Wed, 7 May 2014 18:23:00 +0200 Subject: 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. --- apps/files_sharing/lib/share/file.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'apps/files_sharing/lib') diff --git a/apps/files_sharing/lib/share/file.php b/apps/files_sharing/lib/share/file.php index c0c9e0c107e..a18137e65ba 100644 --- a/apps/files_sharing/lib/share/file.php +++ b/apps/files_sharing/lib/share/file.php @@ -33,10 +33,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; -- cgit v1.2.3