Skip to content

Commit

Permalink
replaceAll() requires a global regex (#2653)
Browse files Browse the repository at this point in the history
  • Loading branch information
PromoFaux authored Jul 24, 2023
2 parents acd3aca + c054d8d commit b00d18b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/pi-hole/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function escapeHtml(text) {

if (text === null) return null;

return text.replaceAll(/[&<>"']/, function (m) {
return text.replaceAll(/[&<>"']/g, function (m) {
return map[m];
});
}
Expand All @@ -43,7 +43,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];
}
Expand Down

0 comments on commit b00d18b

Please sign in to comment.