diff --git a/scripts/pi-hole/js/index.js b/scripts/pi-hole/js/index.js index 6fc26827..3b7de3ff 100644 --- a/scripts/pi-hole/js/index.js +++ b/scripts/pi-hole/js/index.js @@ -262,7 +262,11 @@ function updateTopClientsChart() { if ({}.hasOwnProperty.call(data.top_sources, client)){ // Sanitize client - data.top_sources[escapeHtml(client)] = data.top_sources[client]; + if(escapeHtml(client) !== client) + { + // Make a copy with the escaped index + data.top_sources[escapeHtml(client)] = data.top_sources[client]; + } client = escapeHtml(client); if(client.indexOf("|") > -1) { @@ -308,6 +312,11 @@ function updateTopLists() { for (domain in data.top_queries) { if ({}.hasOwnProperty.call(data.top_queries,domain)){ // Sanitize domain + if(escapeHtml(domain) !== domain) + { + // Make a copy with the escaped index + data.top_queries[escapeHtml(domain)] = data.top_queries[domain]; + } domain = escapeHtml(domain); url = ""+domain+""; percentage = data.top_queries[domain] / data.dns_queries_today * 100;