Bug 33066: Restore HTML escaping

And we add a render function that will escape by default

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>

Signed-off-by: Agustín Moyano <agustinmoyano@theke.io>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jonathan Druart 2023-03-07 17:40:20 +01:00 committed by Tomas Cohen Arazi
parent 1c03ff77b2
commit 4e129cd5fe
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
3 changed files with 19 additions and 4 deletions

View File

@ -224,7 +224,7 @@ export default {
'<a href="/cgi-bin/koha/erm/agreements/' +
row.agreement_id +
'" class="show">' +
row.name +
escape_str(row.name) +
"</a>"
)
},
@ -235,7 +235,9 @@ export default {
searchable: true,
orderable: true,
render: function (data, type, row, meta) {
return row.vendor_id != undefined ? row.vendor.name : ""
return row.vendor_id != undefined
? escape_str(row.vendor.name)
: ""
},
},
{

View File

@ -140,7 +140,7 @@ export default {
'<a href="/cgi-bin/koha/erm/licenses/' +
row.license_id +
'" class="show">' +
row.name +
escape_str(row.name) +
"</a>"
)
},
@ -151,7 +151,9 @@ export default {
searchable: true,
orderable: true,
render: function (data, type, row, meta) {
return row.vendor_id != undefined ? row.vendor.name : ""
return row.vendor_id != undefined
? escape_str(row.vendor.name)
: ""
},
},

View File

@ -50,6 +50,17 @@ export default {
},
buttons,
search: { search: this.$route.query.q },
columnDefs: [
{
targets: "_all",
render: function (data, type, row, meta) {
if (type == "display") {
return escape_str(data)
}
return data
},
},
],
...this.options,
},
hidden_ids,