summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-02-27 14:26:52 +0100
committerRobin Appelman <icewind@owncloud.com>2015-02-27 16:39:58 +0100
commitfc027bceb7309fd2f2b6e30cb781d700076669cd (patch)
treef698e4ed1ba03937b96614c907b68dec1a9483d1 /lib
parent8abb80c64277524fadcbea875e2d559c339ef0b1 (diff)
downloadnextcloud-server-fc027bceb7309fd2f2b6e30cb781d700076669cd.tar.gz
nextcloud-server-fc027bceb7309fd2f2b6e30cb781d700076669cd.zip
Fix cache update when doing a rename that overwrites the target
Diffstat (limited to 'lib')
-rw-r--r--lib/private/files/cache/updater.php5
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)) {