Verified Commit 53b28eeb authored by Camil Staps's avatar Camil Staps 🚀

HTML escaping in test_results.html

parent e67b737d
......@@ -614,7 +614,7 @@ function highlightType(type, callback) {
}
function escapeHTML(unsafe) {
var map = { "&": "&amp;", "<": "&lt;", ">": "&gt;",
var map = { '&': '&amp;', '<': '&lt;', '>': '&gt;',
'"': '&quot;', "'": '&#39;', "/": '&#x2F;' };
return String(unsafe).replace(/[&<>"'\/]/g, function(s){return map[s];});
}
......@@ -77,7 +77,7 @@ function resultToHTML(result) {
var elems = result[i].split('\t');
var cls = elems.shift().replace(/,/g, ' ');
var content = elems.join('\t').replace(/\\n/g, '\n');
html += '<span class="' + cls + '">' + content + '</span>';
html += '<span class="' + cls + '">' + escapeHTML(content) + '</span>';
}
return html;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment