summaryrefslogtreecommitdiffstats
path: root/core/js
diff options
context:
space:
mode:
Diffstat (limited to 'core/js')
-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 7897a2f2842..a411ade7dea 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: {}