diff --git a/scripts/pi-hole/js/utils.js b/scripts/pi-hole/js/utils.js index 6fe90245..c83e7484 100644 --- a/scripts/pi-hole/js/utils.js +++ b/scripts/pi-hole/js/utils.js @@ -17,6 +17,8 @@ function escapeHtml(text) { "'": "'" }; + if (text === null) return null; + return text.replace(/[&<>"']/g, function (m) { return map[m]; }); @@ -31,6 +33,8 @@ function unescapeHtml(text) { "'": "'" }; + if (text === null) return null; + return text.replace(/&(?:amp|lt|gt|quot|#039);/g, function (m) { return map[m]; });