diff options
| author | Alexander Pickering <alexandermpickering@gmail.com> | 2016-05-09 15:21:19 -0400 |
|---|---|---|
| committer | Alexander Pickering <alexandermpickering@gmail.com> | 2016-05-09 15:21:19 -0400 |
| commit | dd2bb2f82f20eec33ebf99c81b61d213c91b299b (patch) | |
| tree | 86e9efb535be1093c3e468d74faf0e2e21bcc95b | |
| parent | d76c91bc98f2a27353f96c81fb587354f7577060 (diff) | |
| download | webpage-dd2bb2f82f20eec33ebf99c81b61d213c91b299b.tar.gz webpage-dd2bb2f82f20eec33ebf99c81b61d213c91b299b.tar.bz2 webpage-dd2bb2f82f20eec33ebf99c81b61d213c91b299b.zip | |
Added a html escaper to parse bugs
| -rw-r--r-- | ws2a/bugs.html | 12 | ||||
| -rw-r--r-- | ws2a/bugsload.js | 12 |
2 files changed, 21 insertions, 3 deletions
diff --git a/ws2a/bugs.html b/ws2a/bugs.html index b5ab100..67ec743 100644 --- a/ws2a/bugs.html +++ b/ws2a/bugs.html @@ -31,7 +31,7 @@ <div class="header clearfix"> <nav> <ul class="nav nav-pills pull-right"> - <li role="presentation"><a href="">Home</a></li> + <li role="presentation"><a href="./index.html">Home</a></li> <li role="presentation" class="active"><a href="./bugs.html">Bugs</a></li> <li role="presentation"><a href="./help.html">Help</a></li> </ul> @@ -41,8 +41,16 @@ <h2 class="sub-header">Recently submitted bugs</h2> <div class="table-responsive"> - <table class="table table-striped" id="bugstable"> + <table class="table table-striped"> <thead> + <tr> + <th>Submitter</th> + <th>Date Submitted</th> + <th>Status</th> + <th>Description</th> + </tr> + </thead> + <tbody id="bugstable"> </tbody> </table> 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, '<') + .replace(/>/g, '>') + .replace(/\//g, '/'); +} + 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); |
