mirror of
https://github.com/grocy/grocy.git
synced 2025-08-17 03:04:36 +00:00
Escape HTML when displaying recipes on /mealplan (references #1868)
This commit is contained in:
@@ -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 => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''', '/': '/', '`': '`', '=': '=' })[s]);;
|
||||
};
|
||||
|
||||
GetUriParam = function(key)
|
||||
{
|
||||
var currentUri = window.location.search.substring(1);
|
||||
|
Reference in New Issue
Block a user