aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2013-01-05 03:30:05 +0100
committerRobin Appelman <icewind@owncloud.com>2013-01-05 03:30:05 +0100
commita5dcbc3d8acfcf2845db281ef73df466508734c5 (patch)
treed35ea81abe5677251d77fc31dd32b390879ded22 /apps
parent0b13b411893c472ce3102ece5d63de34bf872a8d (diff)
downloadnextcloud-server-a5dcbc3d8acfcf2845db281ef73df466508734c5.tar.gz
nextcloud-server-a5dcbc3d8acfcf2845db281ef73df466508734c5.zip
Files: prevent people from renaming files to '.'
Diffstat (limited to 'apps')
-rw-r--r--apps/files/ajax/rename.php2
-rw-r--r--apps/files/js/filelist.js2
2 files changed, 2 insertions, 2 deletions
diff --git a/apps/files/ajax/rename.php b/apps/files/ajax/rename.php
index 45448279fa1..cb0bec399d1 100644
--- a/apps/files/ajax/rename.php
+++ b/apps/files/ajax/rename.php
@@ -12,7 +12,7 @@ $file = stripslashes($_GET["file"]);
$newname = stripslashes($_GET["newname"]);
// Delete
-if( OC_Files::move( $dir, $file, $dir, $newname )) {
+if( $newname !== '.' and OC_Files::move( $dir, $file, $dir, $newname )) {
OCP\JSON::success(array("data" => array( "dir" => $dir, "file" => $file, "newname" => $newname )));
}
else{
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 96dd0323d29..cc47ec2612e 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -149,7 +149,7 @@ var FileList={
event.stopPropagation();
event.preventDefault();
var newname=input.val();
- if (Files.containsInvalidCharacters(newname)) {
+ if (Files.containsInvalidCharacters(newname) || newname === '.') {
return false;
}
if (newname != name) {