Bugzilla – Attachment 188357 Details for
Bug 40659
Allow "My virtual card" format and content to be customizable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40659: Add Scrubber profile and scrub the contents of VIRTUALCARD template
Bug-40659-Add-Scrubber-profile-and-scrub-the-conte.patch (text/plain), 2.06 KB, created by
Lucas Gass (lukeg)
on 2025-10-23 13:19:57 UTC
(
hide
)
Description:
Bug 40659: Add Scrubber profile and scrub the contents of VIRTUALCARD template
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2025-10-23 13:19:57 UTC
Size:
2.06 KB
patch
obsolete
>From 37d03f1b7ebf87ace91e504f6b0edba7cde15de8 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Thu, 23 Oct 2025 13:19:19 +0000 >Subject: [PATCH] Bug 40659: Add Scrubber profile and scrub the contents of > VIRTUALCARD template > >--- > C4/Scrubber.pm | 34 ++++++++++++++++++++++++++++++++++ > opac/opac-virtual-card.pl | 5 +++++ > 2 files changed, 39 insertions(+) > >diff --git a/C4/Scrubber.pm b/C4/Scrubber.pm >index 7197ac5fb89..8086c43ad9d 100644 >--- a/C4/Scrubber.pm >+++ b/C4/Scrubber.pm >@@ -88,6 +88,40 @@ my %scrubbertypes = ( > }, > ], > }, >+ opac => { >+ allow => [ >+ qw( >+ div span h1 h2 h3 h4 h5 h6 p br >+ ul ol li dl dt dd >+ a img svg >+ strong b em i u >+ hr >+ ) >+ ], >+ rules => [ >+ div => { >+ class => qr/^[\w\s\-_]+$/, >+ id => qr/^[\w\-_]+$/, >+ }, >+ >+ span => { >+ class => qr/^[\w\s\-_]+$/, >+ id => qr/^[\w\-_]+$/, >+ }, >+ 'svg' => { >+ 'id' => qr/^[\w\-_]+$/, >+ 'class' => qr/^[\w\s\-_]+$/, >+ 'data-barcode' => qr/^[\w\-_]+$/, >+ 'data-barcode-format' => qr/^[\w\-_]+$/, >+ }, >+ 'img' => { >+ 'src' => qr/^(?:https?:\/\/|\/)/i, >+ 'alt' => 1, >+ 'class' => qr/^[\w\s\-_]+$/, >+ 'id' => qr/^[\w\-_]+$/, >+ }, >+ ], >+ } > ); > > sub new { >diff --git a/opac/opac-virtual-card.pl b/opac/opac-virtual-card.pl >index c44f84910d7..f09ca2559c7 100755 >--- a/opac/opac-virtual-card.pl >+++ b/opac/opac-virtual-card.pl >@@ -76,6 +76,11 @@ my $content = C4::Letters::GetPreparedLetter( > ) > ); > >+my $scrubber = C4::Scrubber->new('opac'); >+my $scrubbed = $scrubber->scrub( $content->{content} ); >+ >+$content->{content} = $scrubbed; >+ > $template->param( > virtualcardview => 1, > patron => $patron, >-- >2.39.5
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 40659
:
187695
|
187696
|
187697
|
187706
|
187894
|
187895
|
187896
| 188357 |
188358
|
188359
|
189633