------------------------------------------------------------
revno: 927
committer: Debian BTS <debb...@busoni>
branch nick: mainline
timestamp: Mon 2010-07-26 15:12:30 +0000
message:
  merge changes from dla source
    ------------------------------------------------------------
    revno: 738.3.227
    committer: Don Armstrong <d...@donarmstrong.com>
    branch nick: source
    timestamp: Sat 2010-07-24 13:54:23 -0700
    message:
      Don't RFC1522 escape ", ( and ). (Closes: #588859). Thanks to Glenn
      Morris
=== modified file 'Debbugs/MIME.pm'
--- Debbugs/MIME.pm     2010-02-01 17:12:32 +0000
+++ Debbugs/MIME.pm     2010-07-26 15:12:19 +0000
@@ -288,8 +288,10 @@
      return undef if not defined $rawstr;
      # We process words in reverse so we can preserve spacing between
      # encoded words. This regex splits on word|nonword boundaries and
-     # nonword|nonword boundaries.
-     my @words = reverse split /(?:(?<=[\s\n])|(?=[\s\n]))/m, $rawstr;
+     # nonword|nonword boundaries. We also consider parenthesis and "
+     # to be nonwords to avoid escaping them in comments in violation
+     # of RFC1522
+     my @words = reverse split /(?:(?<=[\s\n\)\(\"])|(?=[\s\n\)\(\"]))/m, 
$rawstr;
 
      my $previous_word_encoded = 0;
      my $string = '';

=== modified file 'debian/changelog'
--- debian/changelog    2010-05-04 02:27:38 +0000
+++ debian/changelog    2010-07-26 15:12:19 +0000
@@ -27,6 +27,8 @@
     don't use -obq by default anymore.
   * Add urls to control@ mail footer (Closes: #578822). Thanks to Lars
     Wirzenius
+  * Don't RFC1522 escape ", ( and ). (Closes: #588859). Thanks to Glenn
+    Morris
 
  -- Don Armstrong <d...@debian.org>  Wed, 26 Aug 2009 21:32:53 -0700
 

=== modified file 't/01_mime.t'
--- t/01_mime.t 2007-05-21 06:57:15 +0000
+++ t/01_mime.t 2010-07-26 15:12:19 +0000
@@ -1,7 +1,7 @@
 # -*- mode: cperl;-*-
 # $Id: 01_mime.t,v 1.1 2005/08/17 21:46:17 don Exp $
 
-use Test::More tests => 5;
+use Test::More tests => 6;
 
 use warnings;
 use strict;
@@ -21,6 +21,10 @@
  Döñ Ärḿßtrøñĝ <d...@donarmstrong.com>
 END
 
+my $test_str3 =<<'END';
+...@bar.com (J fö"ø)
+END
+
 # 1: test decode
 ok(Debbugs::MIME::decode_rfc1522(q(=?iso-8859-1?Q?D=F6n_Armstr=F3ng?= 
<d...@donarmstrong.com>)) eq
   encode_utf8(q(Dön Armstróng <d...@donarmstrong.com>)),"decode_rfc1522 
decodes and converts to UTF8 properly");
@@ -31,6 +35,8 @@
   "encode_rfc1522 encodes strings that decode_rfc1522 can decode");
 ok(Debbugs::MIME::decode_rfc1522(Debbugs::MIME::encode_rfc1522($test_str2)) eq 
$test_str2,
   "encode_rfc1522 encodes strings that decode_rfc1522 can decode");
+ok(Debbugs::MIME::decode_rfc1522(Debbugs::MIME::encode_rfc1522($test_str3)) eq 
$test_str3,
+  "encode_rfc1522 properly handles parentesis and \"");
 
 
 # Make sure that create_mime_message has encoded headers and doesn't enclude 
any 8-bit characters

Reply via email to