From 44456e5418865c54f3e553e6d6ceaaaa2a074211 Mon Sep 17 00:00:00 2001 From: ajt <> Date: Fri, 1 Dec 2000 14:36:53 -0800 Subject: [PATCH] [project @ 2000-12-01 14:36:53 by ajt] escape +'s in urls --- cgi/common.pl | 13 ++++++++++--- cgi/pkgreport.cgi | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/cgi/common.pl b/cgi/common.pl index d67d7af7..ffa51b66 100644 --- a/cgi/common.pl +++ b/cgi/common.pl @@ -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 { diff --git a/cgi/pkgreport.cgi b/cgi/pkgreport.cgi index 567bea69..868d8194 100755 --- a/cgi/pkgreport.cgi +++ b/cgi/pkgreport.cgi @@ -114,7 +114,7 @@ if (defined $pkg) { print "

Note that with multi-binary packages there may be other\n"; print "reports filed under the different binary package names.

\n"; print "\n"; - printf "

You might like to refer to the %s package page

\n", "http://packages.debian.org/$pkg", "$pkg"; + printf "

You might like to refer to the %s package page

\n", urlsanit("http://packages.debian.org/$pkg"), htmlsanit("$pkg"); } elsif (defined $maint || defined $maintenc) { print "

Note that maintainers may use different Maintainer fields for\n"; print "different packages, so there may be other reports filed under\n"; -- 2.39.5