From 0bb058c6b448a4709e802d44bc989592e440d1f2 Mon Sep 17 00:00:00 2001 From: Plastdroid <5460588+Plastdroid@users.noreply.github.com> Date: Sun, 7 Jun 2026 03:54:05 +0200 Subject: [PATCH] Escape HTML in node names --- static/js/messages.js | 15 ++++++++++++--- static/js/rsvp-tracker.js | 13 +++++++++++-- static/js/status/channel-utilization-gauges.js | 15 ++++++++++++--- 3 files changed, 35 insertions(+), 8 deletions(-) diff --git a/static/js/messages.js b/static/js/messages.js index e15dbb3..22286a2 100644 --- a/static/js/messages.js +++ b/static/js/messages.js @@ -21,6 +21,15 @@ document.addEventListener("DOMContentLoaded", async function () { nodesById: {}, }; + function escapeHtml(s) { + return String(s) + .replaceAll('&', '&') + .replaceAll('<', '<') + .replaceAll('>', '>') + .replaceAll('"', '"') + .replaceAll("'", '''); + } + radioButtons.forEach(radio => { radio.addEventListener("change", fetchMessages); }); @@ -116,13 +125,13 @@ document.addEventListener("DOMContentLoaded", async function () {