[Rt-commit] rt branch, 4.0/att-filename-fix, updated. rt-4.0.0rc6-142-g709155a

? sunnavy sunnavy at bestpractical.com
Wed May 11 03:37:44 EDT 2011


The branch, 4.0/att-filename-fix has been updated
       via  709155a5f490f0243d1aec5f66a26e82d1c68e4a (commit)
       via  1f04962dda0991ccd5b746a9f98def588c8e9e83 (commit)
       via  65bd64b2430c49b10c7db7773c7f7c411e143d07 (commit)
      from  aad5666ae8f9241628050a2f194f6410ec8cf95d (commit)

Summary of changes:
 lib/RT/Attachment.pm         |    7 +------
 lib/RT/I18N.pm               |   10 +++++++---
 sbin/rt-test-dependencies.in |    2 +-
 3 files changed, 9 insertions(+), 10 deletions(-)

- Log -----------------------------------------------------------------
commit 65bd64b2430c49b10c7db7773c7f7c411e143d07
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed May 11 14:57:25 2011 +0800

    Revert "recommended_filename may return strings containing \x.. data"
    
    there is something wrong elsewhere, not here
    
    This reverts commit 7b2622b2642a887fd3d1d3f6c60de265f659012e.

diff --git a/lib/RT/Attachment.pm b/lib/RT/Attachment.pm
index 31d48bd..7fc9aba 100644
--- a/lib/RT/Attachment.pm
+++ b/lib/RT/Attachment.pm
@@ -140,12 +140,7 @@ sub Create {
     #Get the filename
     my $Filename = $Attachment->head->recommended_filename;
     # remove path part. 
-    if ($Filename) {
-        $Filename =~ s!.*/!!;
-        if ( $Filename =~ s/\\x(\w{2})/chr hex $1/ige ) {
-            utf8::decode($Filename);
-        }
-    }
+    $Filename =~ s!.*/!! if $Filename;
 
     # MIME::Head doesn't support perl strings well and can return
     # octets which later will be double encoded in low-level code

commit 1f04962dda0991ccd5b746a9f98def588c8e9e83
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed May 11 15:00:10 2011 +0800

    it's anti-rfc to not encode mime heads

diff --git a/lib/RT/I18N.pm b/lib/RT/I18N.pm
index a1f2af5..88b772d 100644
--- a/lib/RT/I18N.pm
+++ b/lib/RT/I18N.pm
@@ -226,9 +226,13 @@ sub SetMIMEEntityToEncoding {
 
     # convert at least MIME word encoded attachment filename
     foreach my $attr (qw(content-type.name content-disposition.filename)) {
-	if ( my $name = $head->mime_attr($attr) and !$preserve_words ) {
-	    $head->mime_attr( $attr => DecodeMIMEWordsToUTF8($name) );
-	}
+        if ( my $name = $head->mime_attr($attr) and !$preserve_words ) {
+            $head->mime_attr(
+                $attr => MIME::Words::encode_mimewords(
+                    DecodeMIMEWordsToUTF8($name), Charset => $enc,
+                )
+            );
+        }
     }
 
     # If this is a textual entity, we'd need to preserve its original encoding

commit 709155a5f490f0243d1aec5f66a26e82d1c68e4a
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed May 11 15:24:51 2011 +0800

    require 5.502+ of MIME::Entity as it has incompatible changes, see #16909

diff --git a/sbin/rt-test-dependencies.in b/sbin/rt-test-dependencies.in
index 2b34925..15ff1e0 100755
--- a/sbin/rt-test-dependencies.in
+++ b/sbin/rt-test-dependencies.in
@@ -192,7 +192,7 @@ Sys::Syslog 0.16
 Locale::Maketext 1.06
 Locale::Maketext::Lexicon 0.32
 Locale::Maketext::Fuzzy
-MIME::Entity 5.425
+MIME::Entity 5.502
 Mail::Mailer 1.57
 Email::Address
 Text::Wrapper 

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


More information about the Rt-commit mailing list