Browse Source

Bug 25279: (QA follow-up) Use .escapeHtml

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
20.05.x
Tomás Cohen Arazi 4 years ago
committed by Martin Renvoize
parent
commit
8771232293
Signed by: martin.renvoize GPG Key ID: 422B469130441A0F
  1. 2
      koha-tmpl/intranet-tmpl/prog/en/modules/admin/cities.tt
  2. 7
      koha-tmpl/intranet-tmpl/prog/js/staff-global.js

2
koha-tmpl/intranet-tmpl/prog/en/modules/admin/cities.tt

@ -186,7 +186,7 @@
"targets": [0,1,2,3,4],
"render": function (data, type, row, meta) {
if ( type == 'display' ) {
return $('<div />').text(data).html();
return data.escapeHtml();
}
return data;
}

7
koha-tmpl/intranet-tmpl/prog/js/staff-global.js

@ -26,6 +26,13 @@ String.prototype.escapeHtml = function() {
});
};
/*
* Void method for numbers, for consistency
*/
Number.prototype.escapeHtml = function() {
return this;
};
// http://stackoverflow.com/questions/14859281/select-tab-by-name-in-jquery-ui-1-10-0/16550804#16550804
$.fn.tabIndex = function () {
return $(this).parent().children('div').index(this);

Loading…
Cancel
Save