Skip to content

Commit 2e1ee38

Browse files
committed
inject text instead of HTML name
Avoid HTML injection called out by CODEQL.
1 parent 8706658 commit 2e1ee38

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/food/food.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ client.init(function loaded () {
243243
.append($('<img>').attr('title',translate('Edit record')).attr('src',icon_edit).attr('index',i).attr('class','fe_editimg'))
244244
.append($('<img>').attr('title',translate('Delete record')).attr('src',icon_remove).attr('index',i).attr('class','fe_removeimg'))
245245
)
246-
.append($('<span>').addClass('width200px').append(foodlist[i].name))
246+
.append($('<span>').addClass('width200px').text(foodlist[i].name))
247247
.append($('<span>').addClass('width150px').css('text-align','center').append(foodlist[i].portion))
248248
.append($('<span>').addClass('width50px').css('text-align','center').append(foodlist[i].unit))
249249
.append($('<span>').addClass('width100px').css('text-align','center').append(foodlist[i].carbs))

0 commit comments

Comments
 (0)