From aab226cef76cd4e391182eac58689c83b20e1b29 Mon Sep 17 00:00:00 2001 From: Jörn Friedrich Dreyer Date: Tue, 14 Jul 2015 15:12:27 +0200 Subject: don't move files in cache twice, fixes renaming for objectstores --- lib/private/files/cache/updater.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'lib/private/files') diff --git a/lib/private/files/cache/updater.php b/lib/private/files/cache/updater.php index 1e180e7993a..2de0c8fe067 100644 --- a/lib/private/files/cache/updater.php +++ b/lib/private/files/cache/updater.php @@ -171,13 +171,15 @@ class Updater { if ($sourceStorage && $targetStorage) { $targetCache = $targetStorage->getCache($sourceInternalPath); - if ($targetCache->inCache($targetInternalPath)) { - $targetCache->remove($targetInternalPath); - } - if ($sourceStorage === $targetStorage) { - $targetCache->move($sourceInternalPath, $targetInternalPath); - } else { - $targetCache->moveFromCache($sourceStorage->getCache(), $sourceInternalPath, $targetInternalPath); + if ($sourceStorage->getCache($sourceInternalPath)->inCache($sourceInternalPath)) { + if ($targetCache->inCache($targetInternalPath)) { + $targetCache->remove($targetInternalPath); + } + if ($sourceStorage === $targetStorage) { + $targetCache->move($sourceInternalPath, $targetInternalPath); + } else { + $targetCache->moveFromCache($sourceStorage->getCache(), $sourceInternalPath, $targetInternalPath); + } } if (pathinfo($sourceInternalPath, PATHINFO_EXTENSION) !== pathinfo($targetInternalPath, PATHINFO_EXTENSION)) { -- cgit v1.2.3