Escape HTML when displaying recipes on /mealplan (references #1868)

This commit is contained in:
Bernd Bestel
2022-04-21 21:32:28 +02:00
parent c4388a6f8f
commit 845e69fb96
2 changed files with 7 additions and 0 deletions

View File

@@ -21,6 +21,11 @@ String.prototype.replaceAll = function(search, replacement)
return this.replace(new RegExp(search, "g"), replacement);
};
String.prototype.escapeHTML = function()
{
return this.replace(/[&<>"'`=\/]/g, s => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;', '/': '&#x2F;', '`': '&#x60;', '=': '&#x3D;' })[s]);;
};
GetUriParam = function(key)
{
var currentUri = window.location.search.substring(1);