summaryrefslogtreecommitdiffstats
path: root/core
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 /core
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 'core')
-rw-r--r--core/js/js.js8
-rw-r--r--core/js/tests/specHelper.js3
2 files changed, 10 insertions, 1 deletions
diff --git a/core/js/js.js b/core/js/js.js
index 5c737d41793..8c6fc0d9c07 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -225,6 +225,14 @@ var OCP = {},
},
/**
+ * 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));
+ },
+
+ /**
* Redirect to the target URL, can also be used for downloads.
* @param {string} targetURL URL to redirect to
*/
diff --git a/core/js/tests/specHelper.js b/core/js/tests/specHelper.js
index f9bdeae0d64..d940cf068f9 100644
--- a/core/js/tests/specHelper.js
+++ b/core/js/tests/specHelper.js
@@ -94,7 +94,8 @@ window.oc_appswebroots = {
};
window.oc_config = {
session_lifetime: 600 * 1000,
- session_keepalive: false
+ session_keepalive: false,
+ blacklist_files_regex: '\.(part|filepart)$',
};
window.oc_appconfig = {
core: {}