patching accidental leakage of full path of uploaded file when uploading pictures or attachments

v1.18.x
Julian Lam 7 years ago
parent bfa8178663
commit a8ec6a4a9c

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

Loading…
Cancel
Save