summaryrefslogtreecommitdiff
path: root/ws2a/bugsload.js
diff options
context:
space:
mode:
Diffstat (limited to 'ws2a/bugsload.js')
-rw-r--r--ws2a/bugsload.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/ws2a/bugsload.js b/ws2a/bugsload.js
index 4c8b007..1212e15 100644
--- a/ws2a/bugsload.js
+++ b/ws2a/bugsload.js
@@ -1,8 +1,18 @@
+function htmlEscape(str) {
+ return String(str)
+ .replace(/&/g, '&')
+ .replace(/"/g, '"')
+ .replace(/'/g, ''')
+ .replace(/</g, '&lt;')
+ .replace(/>/g, '&gt;')
+ .replace(/\//g, '&#x2F;');
+}
+
function loadLastBugs() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (xhttp.readyState == 4 && xhttp.status == 200) {
- document.getElementById("bugstable").innerHTML = xhttp.responseText;
+ document.getElementById("bugstable").innerHTML = htmlEscape(xhttp.responseText);
}
};
xhttp.open("GET", "/cgi-bin/bugsdata.cgi", true);