]> git.donarmstrong.com Git - debbugs.git/blobdiff - Debbugs/CGI/Pkgreport.pm
Include the protocol (http://) in gWebDomain and gCGIDomain
[debbugs.git] / Debbugs / CGI / Pkgreport.pm
index 696a9e015c382c29555f772b7db61454e32ed5a9..4391197c59a82eb0e44357831f7dc89df697cd72 100644 (file)
@@ -28,7 +28,7 @@ None known.
 use warnings;
 use strict;
 use vars qw($VERSION $DEBUG %EXPORT_TAGS @EXPORT_OK @EXPORT);
-use base qw(Exporter);
+use Exporter qw(import);
 
 use IO::Scalar;
 use Params::Validate qw(validate_with :types);
@@ -41,6 +41,7 @@ use Debbugs::Bugs qw(bug_filter);
 use Debbugs::Packages qw(:mapping);
 
 use Debbugs::Text qw(:templates);
+use Encode qw(decode_utf8);
 
 use POSIX qw(strftime);
 
@@ -127,7 +128,7 @@ sub generate_package_info{
      my @references;
      my $pseudodesc = getpseudodesc();
      if ($package and defined($pseudodesc) and exists($pseudodesc->{$package})) {
-         push @references, "to the <a href=\"http://$config{web_domain}/pseudo-packages$config{html_suffix}\">".
+         push @references, "to the <a href=\"$config{web_domain}/pseudo-packages$config{html_suffix}\">".
               "list of other pseudo-packages</a>";
      }
      elsif (not defined $maint and not @{$param{bugs}}) {
@@ -140,14 +141,14 @@ sub generate_package_info{
      else {
          if ($package and defined $config{package_pages} and length $config{package_pages}) {
               push @references, sprintf "to the <a href=\"%s\">%s package page</a>",
-                   html_escape("http://$config{package_pages}/$package"), html_escape("$package");
+                   html_escape("$config{package_pages}/$package"), html_escape("$package");
          }
          if (defined $config{subscription_domain} and
              length $config{subscription_domain}) {
               my $ptslink = $param{binary} ? $srcforpkg : $package;
               # the pts only wants the source, and doesn't care about src: (#566089)
               $ptslink =~ s/^src://;
-              push @references, q(to the <a href="http://).html_escape("$config{subscription_domain}/$ptslink").q(">Package Tracking System</a>);
+              push @references, q(to the <a href=").html_escape("$config{package_tracking_domain}/$ptslink").q(">Package Tracking System</a>);
          }
          # Only output this if the source listing is non-trivial.
          if ($param{binary} and $srcforpkg) {
@@ -165,9 +166,9 @@ sub generate_package_info{
      if (defined $maint) {
          print {$output} "<p>If you find a bug not listed here, please\n";
          printf {$output} "<a href=\"%s\">report it</a>.</p>\n",
-              html_escape("http://$config{web_domain}/Reporting$config{html_suffix}");
+              html_escape("$config{web_domain}/Reporting$config{html_suffix}");
      }
-     return $output_scalar;
+     return decode_utf8($output_scalar);
 }
 
 
@@ -471,20 +472,22 @@ sub parse_order_statement_into_boolean {
     $statement =~ s/\+/&&/g;
     # replace all , with ||
     $statement =~ s/,/||/g;
-    $statement =~ s{(?<field>[^\&\|\=]+)=(?<value>[^\&\|\=]+)}
-              {
+    $statement =~ s{([^\&\|\=]+) # field
+                    =
+                    ([^\&\|\=]+) # value
+              }{
                   my $ok = 0;
-                  if ($+{field} eq 'tag') {
-                      $ok = 1 if defined $tags->{$+{value}};
+                  if ($1 eq 'tag') {
+                      $ok = 1 if defined $tags->{$2};
                   } else {
-                      $ok = 1 if defined $status->{$+{field}} and
-                          $status->{$+{field}} eq $+{value};
+                      $ok = 1 if defined $status->{$1} and
+                          $status->{$1} eq $2;
                   }
                   $ok;
               }exg;
     # check that the parsed statement is just valid boolean statements
     if ($statement =~ /^([01\(\)\&\|]+)$/) {
-        return eval "$statement";
+        return eval "$1";
     } else {
         # this is an invalid boolean statement
         return 0;