mirror of
https://github.com/pi-hole/web.git
synced 2025-12-24 04:38:28 +00:00
replaceAll() requires a global regex
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -36,7 +36,7 @@ function setConfigValues(topic, key, value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// else: we have a setting we can set
|
// else: we have a setting we can set
|
||||||
var escapedKey = key.replaceAll(/\./, "\\.");
|
var escapedKey = key.replaceAll(".", "\\.");
|
||||||
switch (value.type) {
|
switch (value.type) {
|
||||||
case "enum (unsigned integer)": // fallthrough
|
case "enum (unsigned integer)": // fallthrough
|
||||||
case "enum (string)": {
|
case "enum (string)": {
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ function escapeHtml(text) {
|
|||||||
// Return early when text is not a string
|
// Return early when text is not a string
|
||||||
if (typeof text !== "string") return text;
|
if (typeof text !== "string") return text;
|
||||||
|
|
||||||
return text.replaceAll(/[&<>"']/, function (m) {
|
return text.replaceAll(/[&<>"']/g, function (m) {
|
||||||
return map[m];
|
return map[m];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -54,7 +54,7 @@ function unescapeHtml(text) {
|
|||||||
if (text === null) return null;
|
if (text === null) return null;
|
||||||
|
|
||||||
return text.replaceAll(
|
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) {
|
function (m) {
|
||||||
return map[m];
|
return map[m];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user