Deprecate OC.fileIsBlacklisted and move it to the bundle

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
Christoph Wurst 2019-05-14 10:06:17 +02:00
parent c2177caf52
commit 2f5df9387d
No known key found for this signature in database
GPG key ID: CC42AC2A7F0E56D8
7 changed files with 11 additions and 9 deletions

View file

@ -139,7 +139,7 @@
throw t('files', 'File name cannot be empty.');
} else if (trimmedName.indexOf('/') !== -1) {
throw t('files', '"/" is not allowed inside a file name.');
} else if (OC.fileIsBlacklisted(trimmedName)) {
} else if (!!(trimmedName.match(OC.config.blacklist_files_regex))) {
throw t('files', '"{name}" is not an allowed filetype', {name: name});
}

BIN
core/js/dist/login.js vendored

Binary file not shown.

Binary file not shown.

BIN
core/js/dist/main.js vendored

Binary file not shown.

Binary file not shown.

View file

@ -9,14 +9,6 @@ Object.assign(window.OC, {
theme: window.oc_defaults || {},
/**
* Check if a user file is allowed to be handled.
* @param {string} file to check
*/
fileIsBlacklisted: function(file) {
return !!(file.match(OC.config.blacklist_files_regex));
},
/**
* Parses a URL query string into a JS map
* @param {string} queryString query string in the format param1=1234&param2=abcde&param3=xyz

View file

@ -109,6 +109,16 @@ export default {
PERMISSION_UPDATE,
TAG_FAVORITE,
/*
* Deprecated helpers to be removed
*/
/**
* Check if a user file is allowed to be handled.
* @param {string} file to check
* @deprecated 17.0.0
*/
fileIsBlacklisted: file => !!(file.match(Config.blacklist_files_regex)),
addScript,
addStyle,
Apps,