mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-29 01:56:12 +01:00
feat: deprecate file.isFileTypeAllowed
use image.isFileTypeAllowed, this function was always meant for images
This commit is contained in:
@@ -66,7 +66,7 @@ async function uploadAsImage(req, uploadedFile) {
|
||||
uid: req.uid,
|
||||
});
|
||||
}
|
||||
await file.isFileTypeAllowed(uploadedFile.path);
|
||||
await image.isFileTypeAllowed(uploadedFile.path);
|
||||
|
||||
let fileObj = await uploadsController.uploadFile(req.uid, uploadedFile);
|
||||
|
||||
@@ -123,7 +123,7 @@ uploadsController.uploadThumb = async function (req, res, next) {
|
||||
if (!uploadedFile.type.match(/image./)) {
|
||||
throw new Error('[[error:invalid-file]]');
|
||||
}
|
||||
await file.isFileTypeAllowed(uploadedFile.path);
|
||||
await image.isFileTypeAllowed(uploadedFile.path);
|
||||
await image.resizeImage({
|
||||
path: uploadedFile.path,
|
||||
width: meta.config.topicThumbSize,
|
||||
|
||||
Reference in New Issue
Block a user