summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/journal/browse.html6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/journal/browse.html b/src/journal/browse.html
index 068b296da1..362611b1c2 100644
--- a/src/journal/browse.html
+++ b/src/journal/browse.html
@@ -177,6 +177,10 @@
return u.toString() + " B";
}
+ function escapeHTML(s) {
+ return s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
+ }
+
function machineOnResult(event) {
if ((event.currentTarget.readyState != 4) ||
(event.currentTarget.status != 200 && event.currentTarget.status != 0))
@@ -310,7 +314,7 @@
else if (d.MESSAGE instanceof Array)
buf += "[" + formatBytes(d.MESSAGE.length) + " blob data]";
else
- buf += d.MESSAGE;
+ buf += escapeHTML(d.MESSAGE);
buf += '</a></td></tr>';
}