From a79602114327e06b91dee4200daac2c50e078b39 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 | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/private') diff --git a/lib/private/files/cache/updater.php b/lib/private/files/cache/updater.php index 31a4a7c21e7..2ddee57c787 100644 --- a/lib/private/files/cache/updater.php +++ b/lib/private/files/cache/updater.php @@ -42,6 +42,9 @@ class Updater { * @param int $time */ public function update($path, $time = null) { + if (Scanner::isPartialFile($path)) { + return; + } /** * @var \OC\Files\Storage\Storage $storage * @var string $internalPath @@ -104,6 +107,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