aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorFelix Heidecke <felix@heidecke.me>2017-02-13 16:51:23 +0100
committerMorris Jobke <hey@morrisjobke.de>2017-03-20 01:17:12 -0600
commit11f838f9e4302154ebbcf5bad51faca4a0e28607 (patch)
tree72a13b9d43c94114ee2765cd630df00ee825bb7d /apps
parent528a903a7b23ea628e6ec2fc9a221821297c0bec (diff)
downloadnextcloud-server-11f838f9e4302154ebbcf5bad51faca4a0e28607.tar.gz
nextcloud-server-11f838f9e4302154ebbcf5bad51faca4a0e28607.zip
Add ignore_files to config,
test files against ignore_files list on upload fix typo and indentation Move blacklist declaration to lib/public/Files/FileInfo.php, Rename *ignored to *blacklisted Mocked blacklist_files for testing Mocked blacklist_files for testing Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps')
-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..38a08d4888c 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 allow 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;