Fix CI tests

Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
Christian König
2023-07-22 16:30:34 +02:00
parent 6bd97e2511
commit 827e96d1d0
2 changed files with 5 additions and 5 deletions

View File

@@ -36,7 +36,7 @@ function setConfigValues(topic, key, value) {
}
// else: we have a setting we can set
var escapedKey = key.replace(/\./g, "\\.");
var escapedKey = key.replaceAll(/\./, "\\.");
switch (value.type) {
case "enum (unsigned integer)": // fallthrough
case "enum (string)": {
@@ -127,7 +127,7 @@ function saveSettings() {
tmp = tmp[parts[i]];
}
tmp[parts[parts.length - 1]] = value;
tmp[parts.at(-1)] = value;
// Merge deep object into settings
$.extend(true, settings, obj);

View File

@@ -30,7 +30,7 @@ function escapeHtml(text) {
// Return early when text is not a string
if (typeof text !== "string") return text;
return text.replace(/[&<>"']/g, function (m) {
return text.replaceAll(/[&<>"']/, function (m) {
return map[m];
});
}
@@ -53,8 +53,8 @@ function unescapeHtml(text) {
if (text === null) return null;
return text.replace(
/&(?:amp|lt|gt|quot|#039|Uuml|uuml|Auml|auml|Ouml|ouml|szlig);/g,
return text.replaceAll(
/&(?:amp|lt|gt|quot|#039|Uuml|uuml|Auml|auml|Ouml|ouml|szlig);/,
function (m) {
return map[m];
}