X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=cgi%2Fpkgreport.cgi;h=1ea9a17a314160b2c83314677852e8f5f6312235;hb=05f158937d8e18b9bec70594f465fc078ed3bc59;hp=b7fc845a510e50a8c21958c52a42fa236d5e386b;hpb=dfffc9e4190838650697c3758a477e92f49939a3;p=debbugs.git diff --git a/cgi/pkgreport.cgi b/cgi/pkgreport.cgi index b7fc845..1ea9a17 100755 --- a/cgi/pkgreport.cgi +++ b/cgi/pkgreport.cgi @@ -13,6 +13,12 @@ use warnings; use strict; +# Sanitize environent for taint +BEGIN{ + delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; +} + +binmode(STDOUT,':encoding(UTF-8)'); use POSIX qw(strftime nice); use Debbugs::Config qw(:globals :text :config); @@ -54,6 +60,7 @@ our %param = cgi_parameters(query => $q, qw(bug-rev pend-rev sev-rev), qw(maxdays mindays version), qw(data which dist newest), + qw(noaffects), ], default => $default_params, ); @@ -78,7 +85,7 @@ if (exists $param{form_options} and defined $param{form_options}) { for my $incexc (qw(include exclude)) { next unless exists $param{$incexc}; # normalize tag to tags - $param{$incexc} = [map {s/^tag:/tags:/} grep /\S\:\S/, make_list($param{$incexc})]; + $param{$incexc} = [map {s/^tag:/tags:/; $_} grep /\S\:\S/, make_list($param{$incexc})]; } for my $key (keys %package_search_keys) { next unless exists $param{key}; @@ -99,7 +106,7 @@ if (exists $param{form_options} and defined $param{form_options}) { for my $incexc (qw(include exclude)) { next unless exists $param{$incexc}; # normalize tag to tags - $param{$incexc} = [map {s/^tag:/tags:/} make_list($param{$incexc})]; + $param{$incexc} = [map {s/^tag:/tags:/; $_} make_list($param{$incexc})]; } @@ -429,6 +436,7 @@ my $result = pkg_htmlizebugs(bugs => \@bugs, (exists $param{dist})?(dist => $param{dist}):(), ); +print "Cache-Control: public, max-age=300\n"; print "Content-Type: text/html; charset=utf-8\n\n"; print "\n";