From aa660a347563c29cdfc0e4b5af8ff9f18e923a13 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Wed, 2 Oct 2013 13:26:38 +0200 Subject: [PATCH] remove deleted shares from the database table oc_share --- apps/files_sharing/lib/updater.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/apps/files_sharing/lib/updater.php b/apps/files_sharing/lib/updater.php index a43ab2e2a0a..e0f8fc5f0f6 100644 --- a/apps/files_sharing/lib/updater.php +++ b/apps/files_sharing/lib/updater.php @@ -57,6 +57,14 @@ class Shared_Updater { } } + private static function removeShare($path) { + $fileInfo = \OC\Files\Filesystem::getFileInfo($path); + $fileSource = $fileInfo['fileid']; + + $query = \OC_DB::prepare('DELETE FROM `*PREFIX*share` WHERE `file_source`=?'); + \OC_DB::executeAudited($query, array($fileSource)); + } + /** * @param array $params */ @@ -77,8 +85,10 @@ class Shared_Updater { */ static public function deleteHook($params) { self::correctFolders($params['path']); + self::removeShare($params['path']); } + /** * @param array $params */ -- 2.39.5