mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: tag handling when remote objects contain tags without leading # symbol
This commit is contained in:
@@ -162,8 +162,12 @@ Notes.assert = async (uid, input, options = { skipChecks: false }) => {
|
||||
const systemTags = (meta.config.systemTags || '').split(',');
|
||||
const maxTags = await categories.getCategoryField(cid, 'maxTags');
|
||||
tags = (mainPost._activitypub.tag || [])
|
||||
.filter(o => o.type === 'Hashtag' && !systemTags.includes(o.name.slice(1)))
|
||||
.map(o => o.name.slice(1));
|
||||
.map((tag) => {
|
||||
tag.name = tag.name.startsWith('#') ? tag.name.slice(1) : tag.name;
|
||||
return tag;
|
||||
})
|
||||
.filter(o => o.type === 'Hashtag' && !systemTags.includes(o.name))
|
||||
.map(t => t.name);
|
||||
|
||||
if (tags.length > maxTags) {
|
||||
tags.length = maxTags;
|
||||
|
||||
Reference in New Issue
Block a user