summaryrefslogtreecommitdiffstats
path: root/lib/files.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/files.php')
-rw-r--r--lib/files.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/files.php b/lib/files.php
index 469c3a15b8e..d5bebb7e549 100644
--- a/lib/files.php
+++ b/lib/files.php
@@ -167,10 +167,12 @@ class OC_Files {
* @param file $target
*/
public static function move($sourceDir,$source,$targetDir,$target){
- if(OC_User::isLoggedIn() && ($sourceDir != '' || $source != 'Shared')){
+ if(OC_User::isLoggedIn() && ($sourceDir != '' || $source != 'Shared') && !OC_Filesystem::file_exists($targetDir.'/'.$target)){
$targetFile=self::normalizePath($targetDir.'/'.$target);
$sourceFile=self::normalizePath($sourceDir.'/'.$source);
return OC_Filesystem::rename($sourceFile,$targetFile);
+ } else {
+ return false;
}
}