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]; }