From fc027bceb7309fd2f2b6e30cb781d700076669cd Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 27 Feb 2015 14:26:52 +0100 Subject: Fix cache update when doing a rename that overwrites the target --- lib/private/files/cache/updater.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/private/files/cache/updater.php b/lib/private/files/cache/updater.php index 9f4cbfeff8c..eeb763921bb 100644 --- a/lib/private/files/cache/updater.php +++ b/lib/private/files/cache/updater.php @@ -45,7 +45,7 @@ class Updater { * @param int $time */ public function update($path, $time = null) { - if(Scanner::isPartialFile($path)) { + if (Scanner::isPartialFile($path)) { return; } /** @@ -116,6 +116,9 @@ class Updater { if ($sourceStorage && $targetStorage) { if ($sourceStorage === $targetStorage) { $cache = $sourceStorage->getCache($sourceInternalPath); + if ($cache->inCache($targetInternalPath)) { + $cache->remove($targetInternalPath); + } $cache->move($sourceInternalPath, $targetInternalPath); if (pathinfo($sourceInternalPath, PATHINFO_EXTENSION) !== pathinfo($targetInternalPath, PATHINFO_EXTENSION)) { -- cgit v1.2.3