Skip to content

Commit

Permalink
maintain taint flag when encoding MIME on old perl
Browse files Browse the repository at this point in the history
On perl 5.8.8 and below, loading utf8_heavy.pl (which happens implictly
in many places) will cause a split using a character class to not
maintain the taint flag.  Since the MIME header encoding reconstructs
the string after splitting it, we need to explicitly copy the taint flag
using a substr($s, 0, 0).
  • Loading branch information
haarg committed Jan 22, 2015
1 parent 573190b commit f43da80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Encode/MIME/Header.pm
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ sub encode($$;$) {
push @line, join( "\n " => @subline );
}
$_[1] = '' if $chk;
return join( "\n", @line );
return (substr($str, 0, 0) . join( "\n", @line ));
}

use constant HEAD => '=?UTF-8?';
Expand Down

0 comments on commit f43da80

Please sign in to comment.