From 118033cac6fe72fed5b54ee06d3e3809c4e4aefa Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 3 Feb 2014 16:36:21 +0100 Subject: [PATCH] Also clean up the filecache table when deleting a storage entry --- lib/private/files/cache/storage.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/private/files/cache/storage.php b/lib/private/files/cache/storage.php index 6d7a1002c1b..5b1b30176e8 100644 --- a/lib/private/files/cache/storage.php +++ b/lib/private/files/cache/storage.php @@ -77,10 +77,16 @@ class Storage { * @param string $storageId */ public static function remove($storageId) { + $storageCache = new Storage($storageId); + $numericId = $storageCache->getNumericId(); + if (strlen($storageId) > 64) { $storageId = md5($storageId); } $sql = 'DELETE FROM `*PREFIX*storages` WHERE `id` = ?'; \OC_DB::executeAudited($sql, array($storageId)); + + $sql = 'DELETE FROM `*PREFIX*filecache` WHERE `storage` = ?'; + \OC_DB::executeAudited($sql, array($numericId)); } }