Skip to content

Node.js based forum software built for the modern web

fix: https://github.com/NodeBB/NodeBB/pull/8759

Barış Soner Uşaklı9ee1fb490ef8
diff --git a/src/controllers/uploads.js b/src/controllers/uploads.js
index 709eed54ea..df1f930401 100644
--- a/src/controllers/uploads.js
+++ b/src/controllers/uploads.js
@@ -117,6 +117,7 @@ uploadsController.uploadThumb = async function (req, res, next) {
throw new Error('[[error:invalid-file]]');
}
await image.isFileTypeAllowed(uploadedFile.path);
+ await image.checkDimensions(uploadedFile.path);
await image.resizeImage({
path: uploadedFile.path,
width: meta.config.topicThumbSize,
diff --git a/src/topics/thumb.js b/src/topics/thumb.js
index 3988fd5440..f32c4fa96d 100644
--- a/src/topics/thumb.js
+++ b/src/topics/thumb.js
@@ -47,6 +47,7 @@ module.exports = function (Topics) {
await image.isFileTypeAllowed(pathToUpload);
+ await image.checkDimensions(pathToUpload);
await image.resizeImage({
path: pathToUpload,
width: meta.config.topicThumbSize,