summaryrefslogtreecommitdiff
path: root/ws2a/bugsload.js
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2016-05-09 15:32:24 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2016-05-09 15:32:24 -0400
commit08c9221ad098c14761324be9c941af84bc63ad79 (patch)
tree2af4a9e1c2abf4742285d2c6a43919ee8fb34f16 /ws2a/bugsload.js
parentdd2bb2f82f20eec33ebf99c81b61d213c91b299b (diff)
downloadwebpage-08c9221ad098c14761324be9c941af84bc63ad79.tar.gz
webpage-08c9221ad098c14761324be9c941af84bc63ad79.tar.bz2
webpage-08c9221ad098c14761324be9c941af84bc63ad79.zip
Moved html character escapeing to the server side
Diffstat (limited to 'ws2a/bugsload.js')
-rw-r--r--ws2a/bugsload.js12
1 files changed, 1 insertions, 11 deletions
diff --git a/ws2a/bugsload.js b/ws2a/bugsload.js
index 1212e15..4c8b007 100644
--- a/ws2a/bugsload.js
+++ b/ws2a/bugsload.js
@@ -1,18 +1,8 @@
-function htmlEscape(str) {
- return String(str)
- .replace(/&/g, '&amp;')
- .replace(/"/g, '&quot;')
- .replace(/'/g, '&#39;')
- .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 = htmlEscape(xhttp.responseText);
+ document.getElementById("bugstable").innerHTML = xhttp.responseText;
}
};
xhttp.open("GET", "/cgi-bin/bugsdata.cgi", true);