From bd3b2270129ac51cfaa13924720988cae46c4268 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 d10a61e0df..69465f791d 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);