fix: check uploadName

This commit is contained in:
Barış Soner Uşaklı
2020-01-19 11:56:13 -05:00
parent 1656738359
commit 153b1a0eaa

View File

@@ -18,6 +18,10 @@ module.exports = function (User) {
throw new Error('[[error:no-privileges]]');
}
if (uploadName.startsWith('.')) {
throw new Error('[[error:invalid-path]]');
}
winston.verbose('[user/deleteUpload] Deleting ' + uploadName);
await Promise.all([
file.delete(path.join(nconf.get('upload_path'), uploadName)),