mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46: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]]');
|
throw new Error('[[error:no-privileges]]');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (uploadName.startsWith('.')) {
|
||||||
|
throw new Error('[[error:invalid-path]]');
|
||||||
|
}
|
||||||
|
|
||||||
winston.verbose('[user/deleteUpload] Deleting ' + uploadName);
|
winston.verbose('[user/deleteUpload] Deleting ' + uploadName);
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
file.delete(path.join(nconf.get('upload_path'), uploadName)),
|
file.delete(path.join(nconf.get('upload_path'), uploadName)),
|
||||||
|
|||||||
Reference in New Issue
Block a user