]> source.dussan.org Git - nextcloud-server.git/commitdiff
Prevent special characters from breaking the file drop remote url 13152/head
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Tue, 18 Dec 2018 08:17:49 +0000 (09:17 +0100)
committerBackportbot <backportbot-noreply@rullzer.com>
Wed, 19 Dec 2018 08:55:09 +0000 (08:55 +0000)
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
apps/files_sharing/js/files_drop.js

index 8d1273f187291d49bee622fb945feb0d8ffbcaae..9f3caf62ce0fafebb149637a9d92159ac9836650 100644 (file)
                                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);