Skip to content

Node.js based forum software built for the modern web

properly closes #6698

Julian Lam2ce6a8575656
diff --git a/src/flags.js b/src/flags.js
index 0f056fa295..a453dccf03 100644
--- a/src/flags.js
+++ b/src/flags.js
@@ -99,10 +99,7 @@ Flags.get = function (flagId, callback) {
target_readable: data.base.type.charAt(0).toUpperCase() + data.base.type.slice(1) + ' ' + data.base.targetId,
target: payload.targetObj,
history: data.history,
- notes: data.notes.map((note) => {
- note.content = validator.escape(note.content);
- return note;
- }),
+ notes: data.notes,
reporter: payload.userObj,
}));
});
@@ -323,6 +320,7 @@ Flags.getNotes = function (flagId, callback) {
next(null, notes.map(function (note, idx) {
note.user = users[idx];
+ note.content = validator.escape(note.content);
return note;
}));
});