Skip to content

Commit

Permalink
Properly escape html entities in debug
Browse files Browse the repository at this point in the history
Fixes #276
  • Loading branch information
knolleary committed Jul 17, 2014
1 parent 84a0e8c commit f80c410
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion nodes/core/core/20-inject.html
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@
},
button: {
onclick: function() {
var label = (this.name||this.payload).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
var label = (this.name||this.payload).replace(/&/g,"&amp;amp;").replace(/</g,"&amp;lt;").replace(/>/g,"&amp;gt;");
d3.xhr("inject/"+this.id).post(function(err,resp) {
if (err) {
if (err.status == 404) {
Expand Down
6 changes: 3 additions & 3 deletions nodes/core/core/58-debug.html
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@
}

};
var name = (o.name?o.name:o.id).toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
var topic = (o.topic||"").toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
var payload = (o.msg||"").toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
var name = (o.name?o.name:o.id).toString().replace(/&/g,"&amp;amp;").replace(/</g,"&amp;lt;").replace(/>/g,"&amp;gt;");
var topic = (o.topic||"").toString().replace(/&/g,"&amp;amp;").replace(/</g,"&amp;lt;").replace(/>/g,"&amp;gt;");
var payload = (o.msg||"").toString().replace(/&/g,"&amp;amp;").replace(/</g,"&amp;lt;").replace(/>/g,"&amp;gt;");
msg.className = 'debug-message'+(o.level?(' debug-message-level-'+o.level):'')
msg.innerHTML = '<span class="debug-message-date">'+getTimestamp()+'</span>'+
'<span class="debug-message-name">['+name+']</span>'+
Expand Down

0 comments on commit f80c410

Please sign in to comment.