Merge pull request #13152 from nextcloud/backport/13133/stable14

[stable14] Prevent special characters from breaking the file drop remote url
This commit is contained in:
John Molakvoæ 2018-12-19 11:22:01 +01:00 committed by GitHub
commit fa08e9639c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);