From: Don Armstrong Date: Thu, 10 Sep 2009 15:53:41 +0000 (-0700) Subject: Ditch \r and \n in status fields (closes: #545895) X-Git-Tag: release/2.6.0~436^2 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=f201866909d36f988747115360b045d421f58346;p=debbugs.git Ditch \r and \n in status fields (closes: #545895) --- diff --git a/Debbugs/Status.pm b/Debbugs/Status.pm index 05275403..5b6e9dcf 100644 --- a/Debbugs/Status.pm +++ b/Debbugs/Status.pm @@ -232,7 +232,11 @@ sub read_bug{ for my $line (@lines) { if ($line =~ /(\S+?): (.*)/) { my ($name, $value) = (lc $1, $2); - $data{$namemap{$name}} = $value if exists $namemap{$name}; + # this is a bit of a hack; we should never, ever have \r + # or \n in the fields of status. Kill them off here. + # [Eventually, this should be superfluous.] + $value =~ s/[\r\n]//g; + $data{$namemap{$name}} = $value if exists $namemap{$name}; } } for my $field (keys %fields) { @@ -522,6 +526,13 @@ sub makestatus { } } + # this is a bit of a hack; we should never, ever have \r or \n in + # the fields of status. Kill them off here. [Eventually, this + # should be superfluous.] + for my $field (keys %newdata) { + $newdata{$field} =~ s/[\r\n]//g if defined $newdata{$field}; + } + if ($version == 1) { for my $field (@v1fieldorder) { if (exists $newdata{$field} and defined $newdata{$field}) { diff --git a/debian/changelog b/debian/changelog index 2fa786d0..8dc1bf31 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,7 @@ debbugs (2.4.2~exp1) experimental; urgency=low * Allow (almost) exactly what RFC2822 allows in comments (closes: #497144) * Fix problem with non-existant /etc/debbugs/config + * Ditch \r and \n in status fields (closes: #545895) -- Don Armstrong Wed, 26 Aug 2009 21:32:53 -0700