From 6a414f07a64d82281f18751cfef558b7a8928c23 Mon Sep 17 00:00:00 2001 From: don <> Date: Sat, 16 Jul 2005 17:49:31 -0800 Subject: [PATCH] [project @ 2005-07-16 18:49:31 by don] * Use uri_escape to escape URI's before sending them back out so the name of the file doesn't munge the query string. (URI handling really needs to be improved, but this will work for starters.) [#301606 part 1] * call decode_rfc1522 on the filename returned so that encoded filenames get decoded to something "reasonable." [#301606 part 2] * We now require URI::Escape --- cgi/bugreport.cgi | 1 + cgi/common.pl | 4 +++- debian/control | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cgi/bugreport.cgi b/cgi/bugreport.cgi index 28035e21..f46cad8c 100755 --- a/cgi/bugreport.cgi +++ b/cgi/bugreport.cgi @@ -68,6 +68,7 @@ sub display_entity ($$$$\$\@) { my $type = $entity->effective_type; my $filename = $entity->head->recommended_filename; $filename = '' unless defined $filename; + $filename = decode_rfc1522($filename); if ($top) { $$this .= htmlsanit(decode_rfc1522($entity->stringify_header)) diff --git a/cgi/common.pl b/cgi/common.pl index db9d1f4d..74da3c45 100644 --- a/cgi/common.pl +++ b/cgi/common.pl @@ -6,6 +6,8 @@ use Mail::Address; use MLDBM qw/DB_File/; use POSIX qw/ceil/; +use URI::Escape; + $config_path = '/etc/debbugs'; $lib_path = '/usr/lib/debbugs'; require "$lib_path/errorlib"; @@ -463,7 +465,7 @@ sub dlurl { } $params .= "&archive=yes" if ($common_archive); my $pathinfo = ''; - $pathinfo = "/$filename" if $filename ne ''; + $pathinfo = '/'.uri_escape($filename) if $filename ne ''; return urlsanit("bugreport.cgi$pathinfo?$params"); } diff --git a/debian/control b/debian/control index 18db7b57..13522ba6 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ Build-Depends-Indep: debhelper Package: debbugs Architecture: all -Depends: perl5 | perl, exim | mail-transport-agent, libmailtools-perl, ed, libmime-perl, libio-stringy-perl, libmldbm-perl, libunicode-maputf8-perl +Depends: perl5 | perl, exim | mail-transport-agent, libmailtools-perl, ed, libmime-perl, libio-stringy-perl, libmldbm-perl, libunicode-maputf8-perl, liburi-perl Recommends: httpd, links | lynx Suggests: spamassassin Description: The bug tracking system based on the active Debian BTS -- 2.39.5