git ssb

0+

Daan Patchwork / ssb-viewer



forked from cel / ssb-viewer

Commit d55a613b25d45fdb9ba202633cd669d3ab0ca37a

Escape content from messages put into innerHTML

cel committed on 8/31/2018, 8:24:09 PM
Parent: 2e582bd1dc0e9a6709bc4eab94124e250aa64945

Files changed

render.jschanged
render.jsView
@@ -125,9 +125,9 @@
125125 );
126126 }
127127
128128 var figCaption = h('figcaption');
129- figCaption.innerHTML = 'Feed of ' + about.name + '<br>' + marked(String(about.description || ''), opts.marked);
129+ figCaption.innerHTML = 'Feed of ' + escape(about.name) + '<br>' + marked(String(about.description || ''), opts.marked);
130130 return pull(
131131 pull.map(renderMsg.bind(this, opts, '')),
132132 wrap(toolTipTop() + '<main>' +
133133 h('article',
@@ -491,12 +491,12 @@
491491 }
492492 else if (c.type == "git-update") {
493493 var s = h('span.status');
494494 s.innerHTML = "Did a git update " +
495- (c.repoName != undefined ? " in repo " + c.repoName : "") +
495+ (c.repoName != undefined ? " in repo " + escape(c.repoName) : "") +
496496 '<br>' +
497497 (c.commits != undefined ?
498- c.commits.map(com => { return "-" +com.title; }).join('<br>') : "");
498+ c.commits.map(com => { return "-" +escape(com.title); }).join('<br>') : "");
499499 return s;
500500 }
501501 else if (c.type == "ssb-dns") {
502502 return [h('span.status', 'Updated DNS'), renderDefault(c)];

Built with git-ssb-web