From bf9da8458cdd915aa2d6d3ca2133c0d43113f49f Mon Sep 17 00:00:00 2001 From: "Acid Chicken (硫酸鶏)" Date: Fri, 27 Sep 2019 05:16:59 +0900 Subject: Limit the tag counts to 100 (#5263) * Limit the tag counts to 256 * Update create.ts * Update create.ts * Update create.ts * Limit the user tag --- src/services/note/create.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/services/note') diff --git a/src/services/note/create.ts b/src/services/note/create.ts index fcf991793b..0bb6cc1f5c 100644 --- a/src/services/note/create.ts +++ b/src/services/note/create.ts @@ -165,7 +165,7 @@ export default async (user: User, data: Option, silent = false) => new Promise Array.from(tag || '').length <= 128); + tags = tags.filter(tag => Array.from(tag || '').length <= 128).splice(0, 100); if (data.reply && (user.id !== data.reply.userId) && !mentionedUsers.some(u => u.id === data.reply!.userId)) { mentionedUsers.push(await Users.findOne(data.reply.userId).then(ensure)); -- cgit v1.2.3-freya