Bug 25279: HTML escape cells
authorTomas Cohen Arazi <tomascohen@theke.io>
Tue, 5 May 2020 23:28:10 +0000 (20:28 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 12 May 2020 10:40:00 +0000 (11:40 +0100)
This patch makes HTML entities be escaped. It is done in a simple way.
We need to explore ways to do it at datatables.js level but it deserves
its own bug.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

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

index 445d839..f25a6e8 100644 (file)
                 },
                 'dom': 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
                 "order": [[ 1, "asc" ]],
+                "columnDefs": [ {
+                    "targets": [0,1,2,3,4],
+                    "render": function (data, type, row, meta) {
+                        if ( type == 'display' ) {
+                            return $('<div />').text(data).html();
+                        }
+                        return data;
+                    }
+                } ],
                 "columns": [
                     {
                         "data": "city_id",