mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: #12912, strip custom emoji from remote content titles
This commit is contained in:
@@ -110,6 +110,15 @@ Notes.assert = async (uid, input, options = { skipChecks: false }) => {
|
||||
|
||||
// mainPid ok to leave as-is
|
||||
title = name || activitypub.helpers.generateTitle(utils.decodeHTMLEntities(content));
|
||||
|
||||
// Remove any custom emoji from title
|
||||
if (_activitypub && _activitypub.tag && Array.isArray(_activitypub.tag)) {
|
||||
_activitypub.tag
|
||||
.filter(tag => tag.type === 'Emoji')
|
||||
.forEach((tag) => {
|
||||
title = title.replace(new RegExp(tag.name, 'g'), '');
|
||||
});
|
||||
}
|
||||
}
|
||||
mainPid = utils.isNumber(mainPid) ? parseInt(mainPid, 10) : mainPid;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user