Bugzilla – Attachment 140792 Details for
Bug 12758
Failure when loading or parsing XSLT stylesheets over HTTPS
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12758: Add new module call in Koha::XSLT::Base
Bug-12758-Add-new-module-call-in-KohaXSLTBase.patch (text/plain), 2.15 KB, created by
David Nind
on 2022-09-20 15:19:17 UTC
(
hide
)
Description:
Bug 12758: Add new module call in Koha::XSLT::Base
Filename:
MIME Type:
Creator:
David Nind
Created:
2022-09-20 15:19:17 UTC
Size:
2.15 KB
patch
obsolete
>From 3ecdde426e410160c5d0ef20eb379ff5bb9788ad Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 24 Sep 2014 17:01:00 +0200 >Subject: [PATCH] Bug 12758: Add new module call in Koha::XSLT::Base > >Reviving a report back from 2014. The workaround is now moved to a >separate helper module from another patch. > >Test plan: >Test OPACXSLTDetailsDisplay with an https reference. >You may try: >https://library.rijksmuseum.nl/opac-tmpl/bootstrap/en/xslt/zztest.xsl > >If you flush and restart, the opac detail pages will contain the >text 'This is my MARC record.'. > >NOTE: If you point to an xslt file over https that contains includes or >imports, you will still get the error: Failed to load external entity. >To address that, we need to extend the _resolve_includes sub. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: David Nind <david@davidnind.com> >--- > Koha/XSLT/Base.pm | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > >diff --git a/Koha/XSLT/Base.pm b/Koha/XSLT/Base.pm >index 7b6134994f..cdadee741d 100644 >--- a/Koha/XSLT/Base.pm >+++ b/Koha/XSLT/Base.pm >@@ -39,6 +39,9 @@ Koha::XSLT::Base - Facilitate use of XSLT transformations > via the err attribute. > Reloading XSLT files can be done with the refresh method. > >+ The module refers to a (temporary) helper module Koha::XSLT::HTTPS that >+ resolves issues in libxml2/libxslt for https references. >+ > =head1 METHODS > > =head2 new >@@ -117,6 +120,7 @@ Koha::XSLT::Base - Facilitate use of XSLT transformations > use Modern::Perl; > use XML::LibXML; > use XML::LibXSLT; >+use Koha::XSLT::HTTPS; > use Koha::XSLT::Security; > > use base qw(Class::Accessor); >@@ -349,8 +353,11 @@ sub _load { > } > > sub _load_xml_args { >- my $self = shift; >- return $_[1]? { 'string' => $_[1]//'' }: { 'location' => $_[0]//'' }; >+ my ( $self, $filename, $code ) = @_; >+ return Koha::XSLT::HTTPS->load($filename) if $filename && $filename =~ /^https/i; >+ # Workaround for current problems with https location in libxml2/libxslt >+ # Returns response like { string => SOME_CODE } >+ return $code ? { string => $code } : { location => $filename }; > } > > # _set_error >-- >2.30.2
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 12758
:
31974
|
31975
|
136711
|
136712
|
136713
|
138199
|
138200
|
138201
|
140790
|
140791
|
140792
|
142768
|
142770
|
142771
|
142772
|
143504