aboutsummaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorKristian Lyngstol <kristian@bohemians.org>2016-05-27 19:28:51 +0200
committerKristian Lyngstol <kristian@bohemians.org>2016-05-27 19:28:51 +0200
commite3f48c3241c9a9f06b908b14f45af0c5c6e29f7d (patch)
treed782d6be8d5578285cb0a4491a06dfd3fcd7ebe8 /web
parent16384c85a89b9587f304bf37dcb6b287d2a531fb (diff)
front: Sanitize info-box-classname-thing
Fixes broken class list when the description was stuff like "worst: management info" (where the "info" would end up as a class and change the look).
Diffstat (limited to 'web')
-rw-r--r--web/js/nms-info-box.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/web/js/nms-info-box.js b/web/js/nms-info-box.js
index 9efff37..5007cd3 100644
--- a/web/js/nms-info-box.js
+++ b/web/js/nms-info-box.js
@@ -881,7 +881,6 @@ var switchSummaryPanel = function() {
content[i][1] == "No data";
contentCleaned.push(content[i]);
}
-
var table = nmsInfoBox._makeTable(contentCleaned);
this._render(table);
@@ -911,7 +910,7 @@ nmsInfoBox._makeTable = function(content, caption) {
}
for (var v in content) {
tr = table.insertRow(-1);
- tr.className = content[v][0].toLowerCase();
+ tr.className = content[v][0].toLowerCase().replace(/[^a-z0-9_]/g,"");
td1 = tr.insertCell(0);
td2 = tr.insertCell(1);
td1.innerHTML = content[v][0];