don't move file into subdirectory if a file with the same name already exists (fixes #92)

This commit is contained in:
Georg Ehrke 2012-10-28 15:20:20 +01:00
parent be215a097a
commit 4fd0514f0a
1 changed files with 5 additions and 0 deletions

View File

@ -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 {