mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: check uploadName
This commit is contained in:
@@ -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)),
|
||||
|
||||
Reference in New Issue
Block a user