This commit was generated by cvs2svn to compensate for changes in r6252,
[freeside.git] / rt / lib / RT / I18N.pm
index e45faf3..448f4a2 100644 (file)
@@ -289,11 +289,13 @@ sub DecodeMIMEWordsToEncoding {
     my $str = shift;
     my $enc = shift;
 
-   
-    @_ = $str =~ m/([^=]*)=\?([^?]+)\?([QqBb])\?([^?]+)\?=([^=]*)/g;
-
+    @_ = $str =~ m/(.*?)=\?([^?]+)\?([QqBb])\?([^?]+)\?=([^=]*)/gc;
     return ($str) unless (@_);
 
+    # add everything that hasn't matched to the end of the latest
+    # string in array this happen when we have 'key="=?encoded?="; key="plain"'
+    $_[-1] .= substr($str, pos $str);
+
     $str = "";
     while (@_) {
        my ($prefix, $charset, $encoding, $enc_str, $trailing) =