]> Sergey Matveev's repositories - public-inbox.git/commitdiff
eml: fix undefined vars on <Perl 5.28
authorEric Wong <e@80x24.org>
Sat, 26 Dec 2020 12:25:42 +0000 (12:25 +0000)
committerEric Wong <e@80x24.org>
Sat, 26 Dec 2020 20:20:13 +0000 (20:20 +0000)
Encode::MIME::Header::_decode_octets did not correctly default
to Encode::FB_DEFAULT until Encode 2.93 (perl5.git commit
0c541dc5633a341cf44b818014b58e7f8be532e9).  Provide the default
again to work with older Perls.

Reported-by: Ali Alnubani <alialnu@nvidia.com>
Link: https://public-inbox.org/meta/DM6PR12MB49106F8E3BD697B63B943A22DADB0@DM6PR12MB4910.namprd12.prod.outlook.com/
Tested-by: Ali Alnubani <alialnu@nvidia.com>
(cherry picked from commit 46bd595f57cc3d425754b0d0770c125616e74448)

lib/PublicInbox/Eml.pm

index 571edc5c950c7ccd575e6de91ce1326f446ab788..4d3fffc0387ae7653653dbae561ab03551789c29 100644 (file)
@@ -378,7 +378,9 @@ sub header_str_set {
        header_set($self, $name, @vals);
 }
 
        header_set($self, $name, @vals);
 }
 
-sub mhdr_decode ($) { eval { $MIME_Header->decode($_[0]) } // $_[0] }
+sub mhdr_decode ($) {
+       eval { $MIME_Header->decode($_[0], Encode::FB_DEFAULT) } // $_[0];
+}
 
 sub filename {
        my $dis = header_raw($_[0], 'Content-Disposition');
 
 sub filename {
        my $dis = header_raw($_[0], 'Content-Disposition');