diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/ajax/move.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/files/ajax/move.php b/apps/files/ajax/move.php index ddcda553e3d..db8f59b43d1 100644 --- a/apps/files/ajax/move.php +++ b/apps/files/ajax/move.php @@ -12,6 +12,11 @@ $file = stripslashes($_GET["file"]); $target = stripslashes(urldecode($_GET["target"])); +if(OC_Filesystem::file_exists($target . '/' . $file)){ + OCP\JSON::error(array("data" => array( "message" => "Could not move $file - File with this name already exists" ))); + exit; +} + if(OC_Files::move($dir, $file, $target, $file)) { OCP\JSON::success(array("data" => array( "dir" => $dir, "files" => $file ))); } else { |