diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-02-27 14:26:52 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2015-02-27 17:35:28 +0100 |
commit | a79602114327e06b91dee4200daac2c50e078b39 (patch) | |
tree | 9b34c484c4e29fc0efa8d06cb52548f3c391e7e9 /lib/private | |
parent | 0ec73a58e92b34aec7af28208156205945d608d9 (diff) | |
download | nextcloud-server-a79602114327e06b91dee4200daac2c50e078b39.tar.gz nextcloud-server-a79602114327e06b91dee4200daac2c50e078b39.zip |
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 | 6 |
1 files changed, 6 insertions, 0 deletions
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)) { |