Escape content from messages put into innerHTML

This commit is contained in:
cel
2018-08-31 13:24:09 -07:00
parent 2e582bd1dc
commit d55a613b25
+3 -3
View File
@@ -126,7 +126,7 @@ function renderAbout(opts, about, showAllHTML = "") {
} }
var figCaption = h('figcaption'); var figCaption = h('figcaption');
figCaption.innerHTML = 'Feed of ' + about.name + '<br>' + marked(String(about.description || ''), opts.marked); figCaption.innerHTML = 'Feed of ' + escape(about.name) + '<br>' + marked(String(about.description || ''), opts.marked);
return pull( return pull(
pull.map(renderMsg.bind(this, opts, '')), pull.map(renderMsg.bind(this, opts, '')),
wrap(toolTipTop() + '<main>' + wrap(toolTipTop() + '<main>' +
@@ -492,10 +492,10 @@ function render(opts, id, c) {
else if (c.type == "git-update") { else if (c.type == "git-update") {
var s = h('span.status'); var s = h('span.status');
s.innerHTML = "Did a git update " + s.innerHTML = "Did a git update " +
(c.repoName != undefined ? " in repo " + c.repoName : "") + (c.repoName != undefined ? " in repo " + escape(c.repoName) : "") +
'<br>' + '<br>' +
(c.commits != undefined ? (c.commits != undefined ?
c.commits.map(com => { return "-" +com.title; }).join('<br>') : ""); c.commits.map(com => { return "-" +escape(com.title); }).join('<br>') : "");
return s; return s;
} }
else if (c.type == "ssb-dns") { else if (c.type == "ssb-dns") {