From 97ba9247a87d93efdeac5bc65902128fac07e499 Mon Sep 17 00:00:00 2001 From: Thomas Lynch Date: Mon, 28 Sep 2020 23:27:53 -0500 Subject: [PATCH] bug in reply/file requirement settings, NOT related to issue reported in >>>/t/2#334 on demo site --- controllers/forms/makepost.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/forms/makepost.js b/controllers/forms/makepost.js index 01c5f6e6..a32dcc8d 100644 --- a/controllers/forms/makepost.js +++ b/controllers/forms/makepost.js @@ -26,14 +26,14 @@ module.exports = async (req, res, next) => { if (globalLimits.postFiles.max !== 0 && res.locals.board.settings.maxFiles !== 0 && res.locals.numFiles === 0) { if (!req.body.thread && res.locals.board.settings.forceThreadFile) { errors.push('Threads must include a file'); - } else if (res.locals.board.settings.forceReplyFile) { + } else if (req.body.thread && res.locals.board.settings.forceReplyFile) { errors.push('Posts must include a file'); } } if (!req.body.message || req.body.message.length === 0) { if (!req.body.thread && res.locals.board.settings.forceThreadMessage) { errors.push('Threads must include a message'); - } else if (res.locals.board.settings.forceReplyMessage) { + } else if (req.body.therad && res.locals.board.settings.forceReplyMessage) { errors.push('Posts must include a message'); } }