From e3f48c3241c9a9f06b908b14f45af0c5c6e29f7d Mon Sep 17 00:00:00 2001 From: Kristian Lyngstol Date: Fri, 27 May 2016 19:28:51 +0200 Subject: 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). --- web/js/nms-info-box.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'web/js/nms-info-box.js') 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]; -- cgit v1.2.3