diff --git a/scripts/pi-hole/js/settings.js b/scripts/pi-hole/js/settings.js index 6550af02..c2c342fd 100644 --- a/scripts/pi-hole/js/settings.js +++ b/scripts/pi-hole/js/settings.js @@ -36,7 +36,7 @@ function setConfigValues(topic, key, value) { } // else: we have a setting we can set - var escapedKey = key.replaceAll(/\./, "\\."); + var escapedKey = key.replaceAll(".", "\\."); switch (value.type) { case "enum (unsigned integer)": // fallthrough case "enum (string)": { diff --git a/scripts/pi-hole/js/utils.js b/scripts/pi-hole/js/utils.js index a4e82042..604ea3d3 100644 --- a/scripts/pi-hole/js/utils.js +++ b/scripts/pi-hole/js/utils.js @@ -30,7 +30,7 @@ function escapeHtml(text) { // Return early when text is not a string if (typeof text !== "string") return text; - return text.replaceAll(/[&<>"']/, function (m) { + return text.replaceAll(/[&<>"']/g, function (m) { return map[m]; }); } @@ -54,7 +54,7 @@ function unescapeHtml(text) { if (text === null) return null; return text.replaceAll( - /&(?:amp|lt|gt|quot|#039|Uuml|uuml|Auml|auml|Ouml|ouml|szlig);/, + /&(?:amp|lt|gt|quot|#039|Uuml|uuml|Auml|auml|Ouml|ouml|szlig);/g, function (m) { return map[m]; }