[Rt-commit] rt branch, 4.0/protect-more-chars-while-decoding-headers, created. rt-4.0.6-221-g70b8c95

Ruslan Zakirov ruz at bestpractical.com
Thu Jun 28 16:23:01 EDT 2012


The branch, 4.0/protect-more-chars-while-decoding-headers has been created
        at  70b8c951f1d908798e63eea711690b8fa75873c9 (commit)

- Log -----------------------------------------------------------------
commit 70b8c951f1d908798e63eea711690b8fa75873c9
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Thu Jun 28 23:08:45 2012 +0300

    expand list of characters we quote when decoding Q/B
    
    When we get rid of Q/B encodings in formatted fields (From/To/Cc...),
    we have to take care of putting quotes around display name some
    times.
    
    The list comes from Email::Address (which gets it from RFC).

diff --git a/lib/RT/I18N.pm b/lib/RT/I18N.pm
index cadf7cc..d57e715 100644
--- a/lib/RT/I18N.pm
+++ b/lib/RT/I18N.pm
@@ -356,7 +356,7 @@ sub DecodeMIMEWordsToEncoding {
             # confuse us a lot, so only quote it if it isn't quoted
             # already.
             $enc_str = qq{"$enc_str"}
-                if $enc_str =~ /[,;]/
+                if $enc_str =~ /[()<>\[\]:;@\\,.]/
                 and $enc_str !~ /^".*"$/
                 and (!$field || $field =~ /^(?:To$|From$|B?Cc$|Content-)/i);
 

-----------------------------------------------------------------------


More information about the Rt-commit mailing list