fix: #8539, enforce content checks for post queue

This commit is contained in:
Barış Soner Uşaklı
2020-07-31 13:37:14 -04:00
parent 776e34a80f
commit bb224184d8
2 changed files with 31 additions and 17 deletions

View File

@@ -94,6 +94,12 @@ module.exports = function (Posts) {
reply: 'topics:reply',
};
topics.checkContent(data.content);
if (type === 'topic') {
topics.checkTitle(data.title);
await topics.validateTags(data.tags);
}
const [canPost] = await Promise.all([
privileges.categories.can(typeToPrivilege[type], cid, data.uid),
user.isReadyToQueue(data.uid, cid),