Files: prevent people from renaming files to '.'
This commit is contained in:
parent
0b13b41189
commit
a5dcbc3d8a
|
@ -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{
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue