summaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2017-03-20 11:44:57 +0100
committerGitHub <noreply@github.com>2017-03-20 11:44:57 +0100
commitac1aff7d9249523cc66a7cd890f95f0760f1016a (patch)
treeed2be7298b196f1b5aa8ac897287b75d969f956a /apps/files
parentc4b6ff0bab812ebda50406d630b171604fbaac72 (diff)
parent1e61c17932d3c0425c220507ce661ec94d14cb3c (diff)
downloadnextcloud-server-ac1aff7d9249523cc66a7cd890f95f0760f1016a.tar.gz
nextcloud-server-ac1aff7d9249523cc66a7cd890f95f0760f1016a.zip
Merge pull request #3950 from nextcloud/downstream-27149
Forbid to upload part files via web UI
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/js/files.js3
-rw-r--r--apps/files/tests/js/filesSpec.js4
2 files changed, 6 insertions, 1 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index 99f888ce0f7..5b345a45b67 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -101,7 +101,10 @@
throw t('files', '"{name}" is an invalid file name.', {name: name});
} else if (trimmedName.length === 0) {
throw t('files', 'File name cannot be empty.');
+ } else if (OC.fileIsBlacklisted(trimmedName)) {
+ throw t('files', '"{name}" is not an allowed filetype', {name: name});
}
+
return true;
},
displayStorageWarnings: function() {
diff --git a/apps/files/tests/js/filesSpec.js b/apps/files/tests/js/filesSpec.js
index b7627d59fdf..5c3f68b2ba4 100644
--- a/apps/files/tests/js/filesSpec.js
+++ b/apps/files/tests/js/filesSpec.js
@@ -58,7 +58,9 @@ describe('OCA.Files.Files tests', function() {
' ..',
'.. ',
'. ',
- ' .'
+ ' .',
+ 'foo.part',
+ 'bar.filepart'
];
for ( var i = 0; i < fileNames.length; i++ ) {
var threwException = false;