From 0ae4022fb4fc6ade3ed300205ccdcdd32863dcdc Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 3 Feb 2014 16:36:21 +0100 Subject: Also clean up the filecache table when deleting a storage entry --- lib/private/files/cache/storage.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/private/files/cache') 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)); } } -- cgit v1.2.3