summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/share/file.php
diff options
context:
space:
mode:
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 2c59bd3bf92..9950b4d61fd 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;