From 0f2d392b4ba4d72fddc698b0aac9b011f3c21489 Mon Sep 17 00:00:00 2001 From: "Acid Chicken (硫酸鶏)" Date: Sun, 22 Sep 2019 01:21:45 +0900 Subject: Use stringz.length instead of String.length in hashtag length calculation (#5443) * Use stringz.length instead of String.length * length to 128, ignore combining --- src/services/note/create.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/services/note/create.ts') diff --git a/src/services/note/create.ts b/src/services/note/create.ts index 0dd0e1962f..fcf991793b 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 tag.length <= 100); + tags = tags.filter(tag => Array.from(tag || '').length <= 128); 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