]> source.dussan.org Git - nextcloud-server.git/commitdiff
make sure that we only find file/folder shares
authorBjoern Schiessle <schiessle@owncloud.com>
Wed, 9 Oct 2013 15:25:58 +0000 (17:25 +0200)
committerBjoern Schiessle <schiessle@owncloud.com>
Fri, 11 Oct 2013 08:51:42 +0000 (10:51 +0200)
lib/public/share.php

index 0a88ea4ea441594c0b3f4104a204934b34ec96fa..c98071267429f72bc327fd37476f94cffd94f0bf 100644 (file)
@@ -155,13 +155,13 @@ class Share {
 
                while ($source !== -1) {
 
-                       // Fetch all shares of this file path from DB
+                       // Fetch all shares with another user
                        $query = \OC_DB::prepare(
                                'SELECT `share_with`
                                FROM
                                `*PREFIX*share`
                                WHERE
-                               `item_source` = ? AND `share_type` = ?'
+                               `item_source` = ? AND `share_type` = ? AND `item_type` IN (\'file\', \'folder\')'
                        );
 
                        $result = $query->execute(array($source, self::SHARE_TYPE_USER));
@@ -180,7 +180,7 @@ class Share {
                                FROM
                                `*PREFIX*share`
                                WHERE
-                               `item_source` = ? AND `share_type` = ?'
+                               `item_source` = ? AND `share_type` = ? AND `item_type` IN (\'file\', \'folder\')'
                        );
 
                        $result = $query->execute(array($source, self::SHARE_TYPE_GROUP));
@@ -201,7 +201,7 @@ class Share {
                                        FROM
                                        `*PREFIX*share`
                                        WHERE
-                                       `item_source` = ? AND `share_type` = ?'
+                                       `item_source` = ? AND `share_type` = ? AND `item_type` IN (\'file\', \'folder\')'
                                );
 
                                $result = $query->execute(array($source, self::SHARE_TYPE_LINK));