View | Details | Raw Unified | Return to bug 12758
Collapse All | Expand All

(-)a/Koha/XSLT/Base.pm (-7 / +7 lines)
Lines 39-44 Koha::XSLT::Base - Facilitate use of XSLT transformations Link Here
39
    via the err attribute.
39
    via the err attribute.
40
    Reloading XSLT files can be done with the refresh method.
40
    Reloading XSLT files can be done with the refresh method.
41
41
42
    The module refers to a (temporary) helper module Koha::XSLT::Loader that
43
    resolves issues in libxml2/libxslt for https references.
44
42
=head1 METHODS
45
=head1 METHODS
43
46
44
=head2 new
47
=head2 new
Lines 117-122 Koha::XSLT::Base - Facilitate use of XSLT transformations Link Here
117
use Modern::Perl;
120
use Modern::Perl;
118
use XML::LibXML;
121
use XML::LibXML;
119
use XML::LibXSLT;
122
use XML::LibXSLT;
123
use Koha::XSLT::Loader;
120
use Koha::XSLT::Security;
124
use Koha::XSLT::Security;
121
125
122
use base qw(Class::Accessor);
126
use base qw(Class::Accessor);
Lines 327-333 sub _load { Link Here
327
    my $parser = XML::LibXML->new;
331
    my $parser = XML::LibXML->new;
328
    $self->{_security}->set_parser_options($parser);
332
    $self->{_security}->set_parser_options($parser);
329
    my $style_doc = eval {
333
    my $style_doc = eval {
330
        $parser->load_xml( $self->_load_xml_args($filename, $code) )
334
        # Next call is a workaround as long as libxml2/libxslt have problems with https refs
335
        my $args = Koha::XSLT::Loader->load( $filename, $code );
336
        $parser->load_xml($args);
331
    };
337
    };
332
    if ($@) {
338
    if ($@) {
333
        $self->_set_error( XSLTH_ERR_3, $@ );
339
        $self->_set_error( XSLTH_ERR_3, $@ );
Lines 348-358 sub _load { Link Here
348
    return $rv;
354
    return $rv;
349
}
355
}
350
356
351
sub _load_xml_args {
352
    my $self = shift;
353
    return $_[1]? { 'string' => $_[1]//'' }: { 'location' => $_[0]//'' };
354
}
355
356
# _set_error
357
# _set_error
357
# Internal routine for handling error information.
358
# Internal routine for handling error information.
358
359
359
- 

Return to bug 12758