summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/share/file.php
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-05-07 18:23:00 +0200
committerVincent Petry <pvince81@owncloud.com>2014-05-08 10:03:07 +0200
commit28f0e6307fe2b2566108c22edd1c6b1caf0625c8 (patch)
tree140ff8c8fd5186de7ee2e453eb33c07a820fde56 /apps/files_sharing/lib/share/file.php
parent254fa5eb22efa5ba572702064377a6ad9eec9a53 (diff)
downloadnextcloud-server-28f0e6307fe2b2566108c22edd1c6b1caf0625c8.tar.gz
nextcloud-server-28f0e6307fe2b2566108c22edd1c6b1caf0625c8.zip
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.
Diffstat (limited to 'apps/files_sharing/lib/share/file.php')
-rw-r--r--apps/files_sharing/lib/share/file.php10
1 files changed, 6 insertions, 4 deletions
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;