summaryrefslogtreecommitdiff
path: root/ws2a
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2016-05-09 15:21:19 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2016-05-09 15:21:19 -0400
commitdd2bb2f82f20eec33ebf99c81b61d213c91b299b (patch)
tree86e9efb535be1093c3e468d74faf0e2e21bcc95b /ws2a
parentd76c91bc98f2a27353f96c81fb587354f7577060 (diff)
downloadwebpage-dd2bb2f82f20eec33ebf99c81b61d213c91b299b.tar.gz
webpage-dd2bb2f82f20eec33ebf99c81b61d213c91b299b.tar.bz2
webpage-dd2bb2f82f20eec33ebf99c81b61d213c91b299b.zip
Added a html escaper to parse bugs
Diffstat (limited to 'ws2a')
-rw-r--r--ws2a/bugs.html12
-rw-r--r--ws2a/bugsload.js12
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, '&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 = xhttp.responseText;
+ document.getElementById("bugstable").innerHTML = htmlEscape(xhttp.responseText);
}
};
xhttp.open("GET", "/cgi-bin/bugsdata.cgi", true);