diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-01-15 14:57:23 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2013-01-15 14:57:23 +0100 |
commit | 9bf367e7f803d6968dc2c639624ce191d538a5bc (patch) | |
tree | 5ef8bec79c46d548d198ca87bbbc9b16974bb5a5 /apps/files/ajax | |
parent | 3a9ec452729bf9b6a51d36750b095d9ef80a5f7e (diff) | |
parent | bb9cc227c2583adc6b51a1f6d75a9fc8333836b9 (diff) | |
download | nextcloud-server-9bf367e7f803d6968dc2c639624ce191d538a5bc.tar.gz nextcloud-server-9bf367e7f803d6968dc2c639624ce191d538a5bc.zip |
merge master into filesystem
Diffstat (limited to 'apps/files/ajax')
-rw-r--r-- | apps/files/ajax/move.php | 5 | ||||
-rw-r--r-- | apps/files/ajax/rename.php | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/apps/files/ajax/move.php b/apps/files/ajax/move.php index d4eacd962a0..7c1ec974a3d 100644 --- a/apps/files/ajax/move.php +++ b/apps/files/ajax/move.php @@ -11,6 +11,11 @@ $dir = stripslashes($_GET["dir"]); $file = stripslashes($_GET["file"]); $target = stripslashes(rawurldecode($_GET["target"])); +if(\OC\Files\Filesystem::file_exists($target . '/' . $file)) { + OCP\JSON::error(array("data" => array( "message" => "Could not move $file - File with this name already exists" ))); + exit; +} + if ($dir != '' || $file != 'Shared') { $targetFile = \OC\Files\Filesystem::normalizePath($dir . '/' . $file); $sourceFile = \OC\Files\Filesystem::normalizePath($target . '/' . $file); diff --git a/apps/files/ajax/rename.php b/apps/files/ajax/rename.php index b62f61e2b67..970aaa638da 100644 --- a/apps/files/ajax/rename.php +++ b/apps/files/ajax/rename.php @@ -11,7 +11,7 @@ $dir = stripslashes($_GET["dir"]); $file = stripslashes($_GET["file"]); $newname = stripslashes($_GET["newname"]); -if (($dir != '' || $file != 'Shared') and $newname !== '.') { +if ( $newname !== '.' and ($dir != '' || $file != 'Shared') and $newname !== '.') { $targetFile = \OC\Files\Filesystem::normalizePath($dir . '/' . $newname); $sourceFile = \OC\Files\Filesystem::normalizePath($dir . '/' . $file); if(\OC\Files\Filesystem::rename($sourceFile, $targetFile)) { |