From 8e0ebb10a4554adff1fa151c5a9cc8324c86b7d8 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 d10a61e0dfc9a..69465f791dfa2 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);