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