mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-17 03:01:08 +01:00
fix: do not blindly escape a notification's bodyLong
For 7+ years we were escaping this value, but it is in many cases already sanitized (as it may be a post content). For those cases when it is not, I now run it through parse.raw. Instead of escaping, it now strips p, img, and a tags.
This commit is contained in:
@@ -75,7 +75,7 @@ Notifications.getMultiple = async function (nids) {
|
||||
notification.datetimeISO = utils.toISOString(notification.datetime);
|
||||
|
||||
if (notification.bodyLong) {
|
||||
notification.bodyLong = utils.escapeHTML(notification.bodyLong);
|
||||
notification.bodyLong = utils.stripHTMLTags(notification.bodyLong, ['img', 'p', 'a']);
|
||||
}
|
||||
|
||||
notification.user = usersData[index];
|
||||
|
||||
Reference in New Issue
Block a user