From: Bjoern Schiessle Date: Wed, 2 Oct 2013 11:26:38 +0000 (+0200) Subject: remove deleted shares from the database table oc_share X-Git-Tag: v6.0.0alpha2~78^2~4 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=aa660a347563c29cdfc0e4b5af8ff9f18e923a13;p=nextcloud-server.git remove deleted shares from the database table oc_share --- 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 */