Escape text passed in collection sorting
Previously, the ID and title of tips and exercises newly added to the list were gathered from the DOM. While we keep this mechanism, we ensure to escape the text before reusing it.
This commit is contained in:

committed by
Dominic Sauer

parent
2c28e8616a
commit
dfa970664d
@ -225,7 +225,7 @@ $(document).on('turbolinks:load', function () {
|
||||
$('.remove-tip').on('click', removeTip);
|
||||
|
||||
function addTip(id, title) {
|
||||
const tip = {id: id, title: title}
|
||||
const tip = {id: _.escape(id), title: _.escape(title)}
|
||||
const template =
|
||||
'<div class="list-group-item d-block" data-tip-id=' + tip.id + ' data-id="">' +
|
||||
'<span class="fa-solid fa-bars me-3"></span>' + tip.title +
|
||||
|
Reference in New Issue
Block a user