Bugzilla – Attachment 130813 Details for
Bug 29853
Text needs HTML filter before KohaSpan filter
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29853: Add HTML filter before KohaSpan filter
Bug-29853-Add-HTML-filter-before-KohaSpan-filter.patch (text/plain), 3.65 KB, created by
Jonathan Druart
on 2022-02-18 09:17:07 UTC
(
hide
)
Description:
Bug 29853: Add HTML filter before KohaSpan filter
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-02-18 09:17:07 UTC
Size:
3.65 KB
patch
obsolete
>From ad0b8eeaf0dc28f6ae5711384ba898ad6f8fff9d Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Tue, 11 Jan 2022 19:40:35 -1000 >Subject: [PATCH] Bug 29853: Add HTML filter before KohaSpan filter >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Usage of Template Toolkit plugin KohaSpan as filter is actually : > Group [% added.title | $KohaSpan class = 'name' | $raw %] created. > >But KohaSpan filter does not escape HTML characters. >Whe should filter HTML then KohaSpan. > >This patch adds TT html filter before KohaSpan. >Also replaces in Javascript html() with text() >to ensure special caracters are still encoded. >See https://api.jquery.com/text/ > >Test plan : >1) Create a library with name Libra'rie >2) Create a library group with name Grou'pe >3) Play with this group >4) Add library >5) Remove library >6) Edit group >7) Delete group >8) Each time check that &apos, is not interpreted as single quote > >Signed-off-by: Solène Desvaux <solene.desvaux@biblibre.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > .../prog/en/modules/admin/library_groups.tt | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/library_groups.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/library_groups.tt >index d483b056b0a..94e1ec0af43 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/library_groups.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/library_groups.tt >@@ -40,22 +40,22 @@ > [% IF added %] > <div class="dialog message group-added"> > [% IF added.branchcode %] >- [% added.library.branchname | $KohaSpan class = 'name' | $raw %] added to group. >+ [% added.library.branchname | html | $KohaSpan class = 'name' %] added to group. > [% ELSE %] >- Group [% added.title | $KohaSpan class = 'name' | $raw %] created. >+ Group [% added.title | html | $KohaSpan class = 'name' %] created. > [% END %] > </div> > [% ELSIF deleted %] > <div class="dialog message group-deleted"> > [% IF deleted.title %] >- Group [% deleted.title | $KohaSpan class = 'name' | $raw %] has been deleted. >+ Group [% deleted.title | html | $KohaSpan class = 'name' %] has been deleted. > [% ELSE %] >- [% deleted.library | $KohaSpan class = 'name' | $raw %] has been removed from group. >+ [% deleted.library | html | $KohaSpan class = 'name' %] has been removed from group. > [% END %] > </div> > [% ELSIF error_duplicate_title %] > <div class="dialog alert error-duplicate-group-title"> >- A group with the title [% error_duplicate_title | $KohaSpan class = 'name' | $raw %] already exists. >+ A group with the title [% error_duplicate_title | html | $KohaSpan class = 'name' %] already exists. > </div> > [% END %] > >@@ -359,14 +359,14 @@ > } > > function delete_group( id, title ) { >- $('#delete-group-modal-title').html(title); >+ $('#delete-group-modal-title').text( title ); > $('#delete-group-modal-id').val( id ); > $('#delete-group-modal').modal('show'); > } > > function remove_library( id, library, parent_title ) { >- $('#remove-library-modal-library').html( library ); >- $('#remove-library-modal-group').html(parent_title); >+ $('#remove-library-modal-library').text( library ); >+ $('#remove-library-modal-group').text( parent_title ); > $('#remove-library-modal-id').val( id ); > $('#remove-library-modal').modal('show'); > } >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29853
:
129325
|
130547
| 130813