Lines 320-327
sub _load {
Link Here
|
320 |
return; |
320 |
return; |
321 |
} |
321 |
} |
322 |
|
322 |
|
|
|
323 |
my $security = XML::LibXSLT::Security->new(); |
324 |
$security->register_callback( read_file => sub { |
325 |
warn "read_file called in XML::LibXSLT"; |
326 |
#i.e. when using the exsl:document() element or document() function (to read a XML file) |
327 |
my ($tctxt,$value) = @_; |
328 |
return 0; |
329 |
}); |
330 |
$security->register_callback( write_file => sub { |
331 |
warn "write_file called in XML::LibXSLT"; |
332 |
#i.e. when using the exsl:document element (or document() function?) (to write an output file of many possible types) |
333 |
#e.g. |
334 |
#<exsl:document href="file:///tmp/breached.txt"> |
335 |
# <xsl:text>breached!</xsl:text> |
336 |
#</exsl:document> |
337 |
my ($tctxt,$value) = @_; |
338 |
return 0; |
339 |
}); |
340 |
$security->register_callback( read_net => sub { |
341 |
warn "read_net called in XML::LibXSLT"; |
342 |
#i.e. when using the document() function (to read XML from the network) |
343 |
#e.g. <xsl:copy-of select="document('http://localhost')" /> |
344 |
my ($tctxt,$value) = @_; |
345 |
return 0; |
346 |
}); |
347 |
$security->register_callback( write_net => sub { |
348 |
warn "write_net called in XML::LibXSLT"; |
349 |
#NOTE: it's unknown how one would invoke this, but covering our bases anyway |
350 |
my ($tctxt,$value) = @_; |
351 |
return 0; |
352 |
}); |
353 |
|
323 |
#parse sheet |
354 |
#parse sheet |
324 |
my $xslt = XML::LibXSLT->new; |
355 |
my $xslt = XML::LibXSLT->new; |
|
|
356 |
$xslt->security_callbacks( $security ); |
357 |
|
325 |
$rv = $code? $digest.$codelen: $filename; |
358 |
$rv = $code? $digest.$codelen: $filename; |
326 |
$self->{xslt_hash}->{$rv} = eval { $xslt->parse_stylesheet($style_doc) }; |
359 |
$self->{xslt_hash}->{$rv} = eval { $xslt->parse_stylesheet($style_doc) }; |
327 |
if ($@) { |
360 |
if ($@) { |
328 |
- |
|
|