From 879cdc4138609412bc66e9981aedbcfee7bcb61e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Sat, 22 Jul 2023 16:26:56 +0200 Subject: [PATCH] Fix CI tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- scripts/pi-hole/js/db_graph.js | 2 +- scripts/pi-hole/js/utils.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/pi-hole/js/db_graph.js b/scripts/pi-hole/js/db_graph.js index 1c02748a..1eb5ab50 100644 --- a/scripts/pi-hole/js/db_graph.js +++ b/scripts/pi-hole/js/db_graph.js @@ -109,7 +109,7 @@ function computeInterval(from, until) { preverr = err; } - return intervals[intervals.length - 1]; + return intervals.at(-1); } function updateQueriesOverTime() { diff --git a/scripts/pi-hole/js/utils.js b/scripts/pi-hole/js/utils.js index 137db8b6..489f9bed 100644 --- a/scripts/pi-hole/js/utils.js +++ b/scripts/pi-hole/js/utils.js @@ -19,7 +19,7 @@ function escapeHtml(text) { if (text === null) return null; - return text.replace(/[&<>"']/g, function (m) { + return text.replaceAll(/[&<>"']/, function (m) { return map[m]; }); } @@ -42,8 +42,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]; }