[Rt-commit] rt branch, 4.4/require-han-extra-in-attachment-encoded-headers, created. rt-4.4.2-238-g571f6090b

? sunnavy sunnavy at bestpractical.com
Fri May 11 16:53:45 EDT 2018


The branch, 4.4/require-han-extra-in-attachment-encoded-headers has been created
        at  571f6090b886ad88185dc3e89013efe8a9bed68b (commit)

- Log -----------------------------------------------------------------
commit 571f6090b886ad88185dc3e89013efe8a9bed68b
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Sat May 12 04:45:56 2018 +0800

    Require Encode::HanExtra in RT::Attachment::EncodedHeaders when necessary
    
    Otherwise Encode::encode dies when encountering encodings like "gb18030":
    
        Unknown encoding 'gb18030'

diff --git a/lib/RT/Attachment.pm b/lib/RT/Attachment.pm
index 4c544301c..effceeed0 100644
--- a/lib/RT/Attachment.pm
+++ b/lib/RT/Attachment.pm
@@ -637,6 +637,11 @@ This is not protection using quoted printable or base64 encoding.
 sub EncodedHeaders {
     my $self = shift;
     my $encoding = shift || 'utf8';
+    if ( $encoding =~ /^(?:(?:big5(-1984|-2003|ext|plus))|cccii|unisys|euc-tw|gb18030|(?:cns11643-\d+))$/ ) {
+        unless ( Encode::HanExtra->require ) {
+            RT->Logger->error("Please install Encode::HanExtra to handle $encoding");
+        }
+    }
     return Encode::encode( $encoding, $self->Headers );
 }
 

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


More information about the rt-commit mailing list