From b1c1ac145906a868708f4965e04f54d1cc05cf54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Tue, 18 Dec 2018 09:17:49 +0100 Subject: [PATCH] Prevent special characters from breaking the file drop remote url MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- apps/files_sharing/js/files_drop.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/files_sharing/js/files_drop.js b/apps/files_sharing/js/files_drop.js index 8d1273f187..9f3caf62ce 100644 --- a/apps/files_sharing/js/files_drop.js +++ b/apps/files_sharing/js/files_drop.js @@ -35,7 +35,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);