summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/ShareBackend/File.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/lib/ShareBackend/File.php')
-rw-r--r--apps/files_sharing/lib/ShareBackend/File.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/apps/files_sharing/lib/ShareBackend/File.php b/apps/files_sharing/lib/ShareBackend/File.php
index e09591b37c0..dc1018f88a5 100644
--- a/apps/files_sharing/lib/ShareBackend/File.php
+++ b/apps/files_sharing/lib/ShareBackend/File.php
@@ -207,8 +207,15 @@ class File implements \OCP\Share_Backend_File_Dependent {
if (isset($source['parent'])) {
$parent = $source['parent'];
while (isset($parent)) {
- $query = \OCP\DB::prepare('SELECT `parent`, `uid_owner` FROM `*PREFIX*share` WHERE `id` = ?', 1);
- $item = $query->execute(array($parent))->fetchRow();
+ $qb = \OC::$server->getDatabaseConnection()->getQueryBuilder();
+ $qb->select('parent', 'uid_owner')
+ ->from('share')
+ ->where(
+ $qb->expr()->eq('id', $qb->createNamedParameter($parent))
+ );
+ $result = $qb->execute();
+ $item = $result->fetch();
+ $result->closeCursor();
if (isset($item['parent'])) {
$parent = $item['parent'];
} else {