From 04d1d375b1a6c9fa40d5df9559d6bd72ccf7d44d Mon Sep 17 00:00:00 2001 From: Mason James Date: Thu, 25 Jun 2015 06:38:30 +1200 Subject: [PATCH] Bug 14408 (3.16/3.14) regex fix for .tmpl files too --- C4/Auth.pm | 3 ++- t/db_dependent/Auth.t | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index fe550ed451..b307c0e190 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -138,7 +138,8 @@ sub get_template_and_user { C4::Context->interface($in->{type}); my $safe_chars = 'a-zA-Z0-9_\-\/'; - die "bad template path" unless $in->{'template_name'} =~ m/^[$safe_chars]+.tt?$/ig; #sanitize input +warn $in->{'template_name'} ; + die "bad template path" unless $in->{'template_name'} =~ m/^[$safe_chars]+\.(tt$|tmpl$)/ig; #sanitize input $in->{'authnotrequired'} ||= 0; my $template = C4::Templates::gettemplate( diff --git a/t/db_dependent/Auth.t b/t/db_dependent/Auth.t index de2e396a71..764a30da84 100644 --- a/t/db_dependent/Auth.t +++ b/t/db_dependent/Auth.t @@ -8,7 +8,7 @@ use Modern::Perl; use CGI; use Test::MockModule; use List::MoreUtils qw/all any none/; -use Test::More tests => 6; +use Test::More tests => 10; use Test::Warn; use C4::Members; use Koha::AuthUtils qw/hash_password/; -- 2.39.5