aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/updater.php
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-07-08 12:51:32 +0200
committerVincent Petry <pvince81@owncloud.com>2014-07-08 14:53:31 +0200
commitf4f52cf24261f9a6015bf9f2dd721151a8a7e785 (patch)
tree2bb9ebb82e25ed5e0c92bbff1157f9f1b0fe389a /apps/files_sharing/lib/updater.php
parent8da44f2a5be6e768fd554c9e8f5b981997e869db (diff)
downloadnextcloud-server-f4f52cf24261f9a6015bf9f2dd721151a8a7e785.tar.gz
nextcloud-server-f4f52cf24261f9a6015bf9f2dd721151a8a7e785.zip
Fix update cleanup to only affect file and folders
Fix bug in the SQL query that cleans up stray shares for removed files/folders, which is now correctly limited to that item type instead of also removing all other share types.
Diffstat (limited to 'apps/files_sharing/lib/updater.php')
-rw-r--r--apps/files_sharing/lib/updater.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/files_sharing/lib/updater.php b/apps/files_sharing/lib/updater.php
index aac4ed196de..a34140f5a35 100644
--- a/apps/files_sharing/lib/updater.php
+++ b/apps/files_sharing/lib/updater.php
@@ -204,8 +204,8 @@ class Shared_Updater {
static public function fixBrokenSharesOnAppUpdate() {
// delete all shares where the original file no longer exists
$findAndRemoveShares = \OC_DB::prepare('DELETE FROM `*PREFIX*share` ' .
- 'WHERE `file_source` NOT IN ( ' .
- 'SELECT `fileid` FROM `*PREFIX*filecache` WHERE `item_type` IN (\'file\', \'folder\'))'
+ 'WHERE `item_type` IN (\'file\', \'folder\') ' .
+ 'AND `file_source` NOT IN (SELECT `fileid` FROM `*PREFIX*filecache`)'
);
$findAndRemoveShares->execute(array());
}