diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/filecache.php | 4 | ||||
-rw-r--r-- | lib/files.php | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/filecache.php b/lib/filecache.php index 364b908bcfa..811e8a3e6a2 100644 --- a/lib/filecache.php +++ b/lib/filecache.php @@ -155,6 +155,10 @@ class OC_FileCache{ if($root===false){ $root=OC_Filesystem::getRoot(); } + // If replacing an existing file, delete the file + if (self::inCache($newPath, $root)) { + self::delete($newPath, $root); + } $oldPath=$root.$oldPath; $newPath=$root.$newPath; $newParent=self::getParentId($newPath); diff --git a/lib/files.php b/lib/files.php index b8af5e04b71..00cbc63aba0 100644 --- a/lib/files.php +++ b/lib/files.php @@ -202,7 +202,7 @@ class OC_Files { * @param file $target */ public static function move($sourceDir,$source,$targetDir,$target){ - if(OC_User::isLoggedIn() && ($sourceDir != '' || $source != 'Shared') && !OC_Filesystem::file_exists($targetDir.'/'.$target)){ + if(OC_User::isLoggedIn() && ($sourceDir != '' || $source != 'Shared')){ $targetFile=self::normalizePath($targetDir.'/'.$target); $sourceFile=self::normalizePath($sourceDir.'/'.$source); return OC_Filesystem::rename($sourceFile,$targetFile); |