]> git.donarmstrong.com Git - debbugs.git/blobdiff - cgi/pkgreport.cgi
fix captialization of cache control
[debbugs.git] / cgi / pkgreport.cgi
index 3fc500b355114472122bee11d936a0f60203b51f..1ea9a17a314160b2c83314677852e8f5f6312235 100755 (executable)
 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,
                           );
@@ -77,7 +84,8 @@ if (exists $param{form_options} and defined $param{form_options}) {
      }
      for my $incexc (qw(include exclude)) {
          next unless exists $param{$incexc};
-         $param{$incexc} = [grep /\S\:\S/, make_list($param{$incexc})];
+         # normalize tag to tags
+         $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};
@@ -93,6 +101,16 @@ if (exists $param{form_options} and defined $param{form_options}) {
      exit 0;
 }
 
+# normalize innclude/exclude keys; currently this is in two locations,
+# which is suboptimal. Closes: #567407
+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})];
+}
+
+
+
 # map from yes|no to 1|0
 for my $key (qw(repeatmerged bug-rev pend-rev sev-rev)) {
      if (exists $param{$key}){
@@ -418,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 "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";