mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2025-01-05 21:49:24 +01:00
Merge pull request #980 from noobpk/noobpk-fix-xss
Add function `htmlEntities` into template ticket_list.html
This commit is contained in:
commit
91b37f6d73
@ -330,7 +330,11 @@
|
|||||||
function get_url(row) {
|
function get_url(row) {
|
||||||
return "{% url 'helpdesk:view' 1234 %}".replace(/1234/, row.id.toString());
|
return "{% url 'helpdesk:view' 1234 %}".replace(/1234/, row.id.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function htmlEntities(str) {
|
||||||
|
return String(str).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
||||||
|
}
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
// Ticket DataTable Initialization
|
// Ticket DataTable Initialization
|
||||||
$('#ticketTable').DataTable({
|
$('#ticketTable').DataTable({
|
||||||
@ -366,7 +370,7 @@
|
|||||||
if (type === 'display') {
|
if (type === 'display') {
|
||||||
data = '<div class="tickettitle"><a href="' + get_url(row) + '" >' +
|
data = '<div class="tickettitle"><a href="' + get_url(row) + '" >' +
|
||||||
row.id + '. ' +
|
row.id + '. ' +
|
||||||
row.title + '</a></div>';
|
htmlEntities(row.title) + '</a></div>';
|
||||||
}
|
}
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user