diff options
Diffstat (limited to 't/008filter.t')
-rw-r--r-- | t/008filter.t | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/t/008filter.t b/t/008filter.t index 4977658bb..f0a26d13f 100644 --- a/t/008filter.t +++ b/t/008filter.t @@ -15,10 +15,11 @@ # Sample exploit code: '>"><script>alert('Oh dear...')</script> +use 5.10.1; use strict; -use lib qw(. lib t); +use warnings; -use vars qw(%safe); +use lib qw(. lib t); use Bugzilla::Constants; use Support::Templates; @@ -30,6 +31,7 @@ use Cwd; my $oldrecsep = $/; my $topdir = cwd; $/ = undef; +our %safe; foreach my $path (@Support::Templates::include_paths) { $path =~ s|\\|/|g if ON_WINDOWS; # convert \ to / in path if on windows @@ -80,13 +82,13 @@ foreach my $path (@Support::Templates::include_paths) { foreach my $file (@testitems) { # There are some files we don't check, because there is no need to # filter their contents due to their content-type. - if ($file =~ /\.(pm|txt|png)\.tmpl$/) { + if ($file =~ /\.(pm|txt|rst|png)\.tmpl$/) { ok(1, "($lang/$flavor) $file is filter-safe"); next; } - + # Read the entire file into a string - open (FILE, "<$file") || die "Can't open $file: $!\n"; + open (FILE, "<$file") || die "Can't open $file: $!\n"; my $slurp = <FILE>; close (FILE); |