From 3efe49079afcc6a56246d6520ad7f6e1ad9e2549 Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Tue, 3 Dec 2013 11:46:24 +1300 Subject: [PATCH] Bug 11322 : XSS in suggestions - OPAC 1/ Add a suggestion in the opac, with lots of html 2/ View that suggestion in the OPAC, note the html is rendering 3/ Apply the patch 4/ Test again, in prog and bootstrap, no more rendered html --- .../opac-tmpl/bootstrap/en/modules/opac-suggestions.tt | 12 ++++++------ koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt | 14 +++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt index 0d87eff..bb7c1ea 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt @@ -164,18 +164,18 @@ [% END %]

[% suggestions_loo.title |html %]

-

[% IF ( suggestions_loo.author ) %][% suggestions_loo.author %],[% END %] - [% IF ( suggestions_loo.copyrightdate ) %] - [% suggestions_loo.copyrightdate %],[% END %] - [% IF ( suggestions_loo.publishercode ) %] - [% suggestions_loo.publishercode %][% END %] - [% IF ( suggestions_loo.place ) %]([% suggestions_loo.place %])[% END %] - [% IF ( suggestions_loo.collectiontitle ) %] , [% suggestions_loo.collectiontitle %][% END %] +

[% IF ( suggestions_loo.author ) %][% suggestions_loo.author |html %],[% END %] + [% IF ( suggestions_loo.copyrightdate ) %] - [% suggestions_loo.copyrightdate |html %],[% END %] + [% IF ( suggestions_loo.publishercode ) %] - [% suggestions_loo.publishercode |html %][% END %] + [% IF ( suggestions_loo.place ) %]([% suggestions_loo.place |html %])[% END %] + [% IF ( suggestions_loo.collectiontitle ) %] , [% suggestions_loo.collectiontitle |html %][% END %] [% IF ( suggestions_loo.itemtype ) %] - [% suggestions_loo.itemtype %][% END %]

[% IF ( suggestions_loo.note ) %] Note: - [% suggestions_loo.note %] + [% suggestions_loo.note |html %] [% END %] [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt index 0fcd5e2..ebc4847 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt @@ -189,16 +189,16 @@ [% END %]

[% suggestions_loo.title |html %]

-

[% IF ( suggestions_loo.author ) %][% suggestions_loo.author %],[% END %] - [% IF ( suggestions_loo.copyrightdate ) %] - [% suggestions_loo.copyrightdate %],[% END %] - [% IF ( suggestions_loo.publishercode ) %] - [% suggestions_loo.publishercode %][% END %] - [% IF ( suggestions_loo.place ) %]([% suggestions_loo.place %])[% END %] - [% IF ( suggestions_loo.collectiontitle ) %] , [% suggestions_loo.collectiontitle %][% END %] +

[% IF ( suggestions_loo.author ) %][% suggestions_loo.author |html %],[% END %] + [% IF ( suggestions_loo.copyrightdate ) %] - [% suggestions_loo.copyrightdate |html %],[% END %] + [% IF ( suggestions_loo.publishercode ) %] - [% suggestions_loo.publishercode |html %][% END %] + [% IF ( suggestions_loo.place ) %]([% suggestions_loo.place |html %])[% END %] + [% IF ( suggestions_loo.collectiontitle ) %] , [% suggestions_loo.collectiontitle |html%][% END %] [% IF ( suggestions_loo.itemtype ) %] - [% suggestions_loo.itemtype %][% END %]

- [% suggestions_loo.note %] + [% suggestions_loo.note |html %] [% IF ( OPACViewOthersSuggestions ) %] [% IF ( suggestions_loo.branchcodesuggestedby ) %][% suggestions_loo.branchcodesuggestedby %][% ELSE %] [% END %] @@ -215,7 +215,7 @@ [% ELSIF ( suggestions_loo.AVAILABLE ) %]Available in the library [% ELSE %] [% KohaAuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestions_loo.STATUS, 1 ) %] [% END %] - [% IF ( suggestions_loo.reason ) %]([% suggestions_loo.reason %])[% END %] + [% IF ( suggestions_loo.reason ) %]([% suggestions_loo.reason |html %])[% END %] [% END %] -- 1.8.3.2