Bug 42136: Add tests
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
This commit is contained in:
parent
40f6c95400
commit
63097f365a
|
|
@ -18,7 +18,8 @@
|
|||
# along with Koha; if not, see <http://www.gnu.org/licenses>.
|
||||
|
||||
use Modern::Perl;
|
||||
use Test::More tests => 3;
|
||||
use Test::NoWarnings;
|
||||
use Test::More tests => 4;
|
||||
|
||||
use utf8;
|
||||
|
||||
|
|
@ -58,3 +59,24 @@ subtest 'Plugin related tests' => sub {
|
|||
"Processing template toolkit with a Koha plugin works"
|
||||
);
|
||||
};
|
||||
|
||||
subtest 'Security-related tests' => sub {
|
||||
plan tests => 2;
|
||||
|
||||
is(
|
||||
Koha::TemplateUtils::process_tt(
|
||||
q{[% USE dir = Directory('/') ~%]
|
||||
[% FOREACH entry IN dir.list ~%]
|
||||
<p>[% entry.abs %]</p>
|
||||
[% END %]},
|
||||
),
|
||||
q{},
|
||||
"Plugins not allowed for User-entered TT"
|
||||
);
|
||||
|
||||
is(
|
||||
Koha::TemplateUtils::process_tt(q{[% USE raw %][% 'foo' | $raw %]}),
|
||||
q{foo},
|
||||
"Koha plugins are still available"
|
||||
);
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue