mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 09:39:57 +00:00
Escape HTML when displaying recipes on /mealplan (references #1868)
This commit is contained in:
parent
c4388a6f8f
commit
845e69fb96
@ -21,6 +21,11 @@ String.prototype.replaceAll = function(search, replacement)
|
|||||||
return this.replace(new RegExp(search, "g"), replacement);
|
return this.replace(new RegExp(search, "g"), replacement);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
String.prototype.escapeHTML = function()
|
||||||
|
{
|
||||||
|
return this.replace(/[&<>"'`=\/]/g, s => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''', '/': '/', '`': '`', '=': '=' })[s]);;
|
||||||
|
};
|
||||||
|
|
||||||
GetUriParam = function(key)
|
GetUriParam = function(key)
|
||||||
{
|
{
|
||||||
var currentUri = window.location.search.substring(1);
|
var currentUri = window.location.search.substring(1);
|
||||||
|
@ -139,6 +139,8 @@ $(".calendar").each(function()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
recipe.name = recipe.name.escapeHTML();
|
||||||
|
|
||||||
var internalShadowRecipe = FindObjectInArrayByPropertyValue(internalRecipes, "name", mealPlanEntry.day + "#" + mealPlanEntry.id);
|
var internalShadowRecipe = FindObjectInArrayByPropertyValue(internalRecipes, "name", mealPlanEntry.day + "#" + mealPlanEntry.id);
|
||||||
var resolvedRecipe = FindObjectInArrayByPropertyValue(recipesResolved, "recipe_id", internalShadowRecipe.id);
|
var resolvedRecipe = FindObjectInArrayByPropertyValue(recipesResolved, "recipe_id", internalShadowRecipe.id);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user