From 404fbeee729f624c1b3b7d2bfb02f9d538e4319f Mon Sep 17 00:00:00 2001 From: David Cook Date: Tue, 19 Nov 2019 13:56:30 +0000 Subject: [PATCH] Bug 23290: Add test for write_net Test plan: Run t/db_dependent/Koha/XSLT/Security.t Signed-off-by: Marcel de Rooy Signed-off-by: David Cook Signed-off-by: Martin Renvoize --- t/db_dependent/Koha/XSLT/Security.t | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Koha/XSLT/Security.t b/t/db_dependent/Koha/XSLT/Security.t index a934481feb..9c82b85896 100644 --- a/t/db_dependent/Koha/XSLT/Security.t +++ b/t/db_dependent/Koha/XSLT/Security.t @@ -19,7 +19,7 @@ use Modern::Perl; use File::Temp qw/tempfile/; -use Test::More tests => 6; +use Test::More tests => 7; use Test::Warn; use Koha::XSLT::Base; @@ -92,6 +92,22 @@ warning_like { $output= $engine->transform( "", $xslt_file ); } qr/read_net called in XML::LibXSLT/, 'Triggered security callback for read_net'; +# Trigger write_net +$xslt=<<"EOT"; + + + + + Breached! + + + +EOT +$xslt_file = mytempfile($xslt); +warning_like { $output= $engine->transform( "", $xslt_file ); } + qr/write_net called in XML::LibXSLT/, + 'Triggered security callback for write_net'; + # Check remote import (include should be similar) # Trusting koha-community.org DNS here ;) # This should not trigger read_net but fail on the missing import. -- 2.39.5