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: v5.0.13~61 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3c29b1a01c7d480de08df834977827bbab6410ff;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 */