From 1f3015bd2c03b0735f30ad8a695293cf1788df45 Mon Sep 17 00:00:00 2001 From: Maxime Quandalle Date: Mon, 18 Jul 2016 16:56:15 +0200 Subject: Fix #573 --- client/components/main/editor.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'client/components') diff --git a/client/components/main/editor.js b/client/components/main/editor.js index 17429067..95a96236 100755 --- a/client/components/main/editor.js +++ b/client/components/main/editor.js @@ -44,6 +44,8 @@ Template.editor.onRendered(() => { ]); }); +import sanitizeXss from 'xss'; + // XXX I believe we should compute a HTML rendered field on the server that // would handle markdown, emoji and user mentions. We can simply have two // fields, one source, and one compiled version (in HTML) and send only the @@ -86,7 +88,7 @@ Blaze.Template.registerHelper('mentions', new Template('mentions', function() { content = content.replace(fullMention, Blaze.toHTML(link)); } - return HTML.Raw(content); + return HTML.Raw(sanitizeXss(content)); })); Template.viewer.events({ -- cgit v1.2.3-1-g7c22