summaryrefslogtreecommitdiffstats
path: root/apps/files/ajax/move.php
diff options
context:
space:
mode:
authorGeorg Ehrke <dev@georgswebsite.de>2012-10-28 15:20:20 +0100
committerGeorg Ehrke <dev@georgswebsite.de>2012-10-28 15:23:40 +0100
commit4fd0514f0af9286636c3665d02d10700fd0e3141 (patch)
tree74ac507b2710781fe6f04b23035c2611f26f0a7d /apps/files/ajax/move.php
parentbe215a097ae5c4838c7d8928cfab0345d884ed56 (diff)
downloadnextcloud-server-4fd0514f0af9286636c3665d02d10700fd0e3141.tar.gz
nextcloud-server-4fd0514f0af9286636c3665d02d10700fd0e3141.zip
don't move file into subdirectory if a file with the same name already exists (fixes #92)
Diffstat (limited to 'apps/files/ajax/move.php')
-rw-r--r--apps/files/ajax/move.php5
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 {