]> git.donarmstrong.com Git - debbugs.git/commitdiff
Ditch \r and \n in status fields (closes: #545895)
authorDon Armstrong <don@donarmstrong.com>
Thu, 10 Sep 2009 15:53:41 +0000 (08:53 -0700)
committerDon Armstrong <don@donarmstrong.com>
Thu, 10 Sep 2009 15:53:41 +0000 (08:53 -0700)
Debbugs/Status.pm
debian/changelog

index 05275403fee04b8eec19d24d43a871e28a3a514b..5b6e9dcf9963ddd141453909cee26e2fe5d1dac7 100644 (file)
@@ -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}) {
index 2fa786d01aee96991eb104f2d9062d410f57cb13..8dc1bf31bd1a18953a6ccf06636fd2e07d367cf7 100644 (file)
@@ -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 <don@debian.org>  Wed, 26 Aug 2009 21:32:53 -0700