Skip to content

Commit

Permalink
inject text instead of HTML name
Browse files Browse the repository at this point in the history
Avoid HTML injection called out by CODEQL.
  • Loading branch information
bewest committed Oct 1, 2022
1 parent 8706658 commit 2e1ee38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/food/food.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ client.init(function loaded () {
.append($('<img>').attr('title',translate('Edit record')).attr('src',icon_edit).attr('index',i).attr('class','fe_editimg'))
.append($('<img>').attr('title',translate('Delete record')).attr('src',icon_remove).attr('index',i).attr('class','fe_removeimg'))
)
.append($('<span>').addClass('width200px').append(foodlist[i].name))
.append($('<span>').addClass('width200px').text(foodlist[i].name))
.append($('<span>').addClass('width150px').css('text-align','center').append(foodlist[i].portion))
.append($('<span>').addClass('width50px').css('text-align','center').append(foodlist[i].unit))
.append($('<span>').addClass('width100px').css('text-align','center').append(foodlist[i].carbs))
Expand Down

0 comments on commit 2e1ee38

Please sign in to comment.