diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-02-27 17:11:37 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-02-27 17:11:37 +0100 |
commit | b4dfd043d7eef8767cf6727cb0651851b8139da7 (patch) | |
tree | 668d565b94d2c9e3109d253abcfc2423707240c1 /lib/private | |
parent | 970b14d2979cb03d1e9ba96cbce3e43a52835333 (diff) | |
parent | fc027bceb7309fd2f2b6e30cb781d700076669cd (diff) | |
download | nextcloud-server-b4dfd043d7eef8767cf6727cb0651851b8139da7.tar.gz nextcloud-server-b4dfd043d7eef8767cf6727cb0651851b8139da7.zip |
Merge pull request #14575 from owncloud/cache-rename-overwrite
Fix cache update when doing a rename that overwrites the target
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/files/cache/updater.php | 5 |
1 files changed, 4 insertions, 1 deletions
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)) { |