From dc9851cf348b3ed0ca3c3dbc25aa4a9f32b727b1 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Mon, 23 Feb 2026 17:51:49 +0000 Subject: [PATCH] Bug 40255: Allow scrubbed HTML to be used --- Koha/Account/Line.pm | 4 +++- .../prog/en/modules/members/boraccount.tt | 12 +++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Koha/Account/Line.pm b/Koha/Account/Line.pm index 2188fbf33d6..ec13c7dda13 100644 --- a/Koha/Account/Line.pm +++ b/Koha/Account/Line.pm @@ -30,6 +30,7 @@ use Koha::Exceptions::Account; use Koha::Patron::Debarments; use Koha::Notice::Templates; use C4::Letters; +use C4::Scrubber; use base qw(Koha::Object Koha::Object::Mixin::AdditionalFields); @@ -1134,7 +1135,8 @@ sub store { ); if ( $letter && $letter->{content} ) { - $self->description( $letter->{content} ); + my $scrubber = C4::Scrubber->new('note'); + $self->description( $scrubber->scrub( $letter->{content} ) ); } } } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt index 6db3bb56424..10b936fbe14 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt @@ -111,9 +111,15 @@ [% PROCESS account_type_description account=account %] [%- IF account.payment_type %][% AuthorisedValues.GetByCode('PAYMENT_TYPE', account.payment_type) | html %][% END %] - [%- IF account.description %][% account.description | html %][% END %] -  [% IF ( account.itemnumber ) %] - [% account.item.biblio.title | html %] + [%- IF account.description %] + [% # Passing the raw filter here because this content is scrubbed %] + [% account.description | $raw %] + [% END %] + [% IF ( account.itemnumber ) %] + +   + [% account.item.biblio.title | html %] + [% END %]