summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2018-12-19 09:53:56 +0100
committerGitHub <noreply@github.com>2018-12-19 09:53:56 +0100
commit7214a8ea831683e114ae6caf75783b279dd7bb5b (patch)
tree14597a66575c8445d9c0763ef3d6df7b8b3f8bec
parenta0ce0824bdefca67e2023f2dd6cba7daf7414d03 (diff)
parentbd3b2270129ac51cfaa13924720988cae46c4268 (diff)
downloadnextcloud-server-7214a8ea831683e114ae6caf75783b279dd7bb5b.tar.gz
nextcloud-server-7214a8ea831683e114ae6caf75783b279dd7bb5b.zip
Merge pull request #13133 from nextcloud/file-drop-char-fixes
Prevent special characters from breaking the file drop remote url
-rw-r--r--apps/files_sharing/js/files_drop.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/files_sharing/js/files_drop.js b/apps/files_sharing/js/files_drop.js
index d10a61e0dfc..69465f791df 100644
--- a/apps/files_sharing/js/files_drop.js
+++ b/apps/files_sharing/js/files_drop.js
@@ -28,7 +28,11 @@
useHTTPS: OC.getProtocol() === 'https'
});
+ // We only process one file at a time 🤷‍♀️
var name = data.files[0].name;
+ // removing unwanted characters
+ name = name.replace(/["'#%`]/gm, '');
+
try {
// FIXME: not so elegant... need to refactor that method to return a value
Files.isFileNameValid(name);