mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-29 01:56:12 +01:00
patching accidental leakage of full path of uploaded file when uploading pictures or attachments
This commit is contained in:
@@ -73,7 +73,14 @@ function uploadAsImage(req, uploadedFile, callback) {
|
||||
|
||||
resizeImage(fileObj, next);
|
||||
},
|
||||
], callback);
|
||||
], function (err, fileObj) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
delete fileObj.path;
|
||||
callback(null, fileObj);
|
||||
});
|
||||
}
|
||||
|
||||
function uploadAsFile(req, uploadedFile, callback) {
|
||||
@@ -90,7 +97,14 @@ function uploadAsFile(req, uploadedFile, callback) {
|
||||
}
|
||||
uploadsController.uploadFile(req.uid, uploadedFile, next);
|
||||
},
|
||||
], callback);
|
||||
], function (err, fileObj) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
delete fileObj.path;
|
||||
callback(null, fileObj);
|
||||
});
|
||||
}
|
||||
|
||||
function resizeImage(fileObj, callback) {
|
||||
|
||||
Reference in New Issue
Block a user