]> git.donarmstrong.com Git - debbugs.git/commitdiff
[project @ 2000-12-01 14:36:53 by ajt]
authorajt <>
Fri, 1 Dec 2000 22:36:53 +0000 (14:36 -0800)
committerajt <>
Fri, 1 Dec 2000 22:36:53 +0000 (14:36 -0800)
escape +'s in urls

cgi/common.pl
cgi/pkgreport.cgi

index d67d7af78607896edbae6c17c0039608e799d8e9..ffa51b66194049b69a53a9f9481e53fce1a728cc 100644 (file)
@@ -128,7 +128,7 @@ sub submitterurl {
     my $params = "submitter=" . emailfromrfc822($ref);
     $params .= "&archive=yes" if ($common_archive);
     $params .= "&repeatmerged=yes" if ($common_repeatmerged);
-    return $debbugs::gCGIDomain . "pkgreport.cgi" . "?" . $params;
+    return urlsanit($debbugs::gCGIDomain . "pkgreport.cgi" . "?" . $params);
 }
 
 sub mainturl {
@@ -136,7 +136,7 @@ sub mainturl {
     my $params = "maint=" . emailfromrfc822($ref);
     $params .= "&archive=yes" if ($common_archive);
     $params .= "&repeatmerged=yes" if ($common_repeatmerged);
-    return $debbugs::gCGIDomain . "pkgreport.cgi" . "?" . $params;
+    return urlsanit($debbugs::gCGIDomain . "pkgreport.cgi" . "?" . $params);
 }
 
 sub pkgurl {
@@ -145,7 +145,14 @@ sub pkgurl {
     $params .= "&archive=yes" if ($common_archive);
     $params .= "&repeatmerged=yes" if ($common_repeatmerged);
     
-    return $debbugs::gCGIDomain . "pkgreport.cgi" . "?" . "$params";
+    return urlsanit($debbugs::gCGIDomain . "pkgreport.cgi" . "?" . "$params");
+}
+
+sub urlsanit {
+    my $url = shift;
+    $url =~ s/%/%25/g;
+    $url =~ s/\+/%2b/g;
+    return $url;
 }
 
 sub htmlsanit {
index 567bea69e2fe54cbd0c6094801c3fecce649456b..868d819456b8ef677767ce61f46d64bd96ee3914 100755 (executable)
@@ -114,7 +114,7 @@ if (defined $pkg) {
     print "<p>Note that with multi-binary packages there may be other\n";
     print "reports filed under the different binary package names.</p>\n";
     print "\n";
-    printf "<p>You might like to refer to the <a href=\"%s\">%s package page</a></p>\n", "http://packages.debian.org/$pkg", "$pkg";
+    printf "<p>You might like to refer to the <a href=\"%s\">%s package page</a></p>\n", urlsanit("http://packages.debian.org/$pkg"), htmlsanit("$pkg");
 } elsif (defined $maint || defined $maintenc) {
     print "<p>Note that maintainers may use different Maintainer fields for\n";
     print "different packages, so there may be other reports filed under\n";