mirror of
https://github.com/MailScanner/v5.git
synced 2024-11-10 09:13:31 +08:00
Enforce 7 bit characters in filenames (#334)
Fix needed to fully resolve https://github.com/MailScanner/v5/issues/233
This commit is contained in:
parent
dcb5a18ff7
commit
7e89f59321
2 changed files with 4 additions and 2 deletions
|
@ -26,8 +26,9 @@ sub output_path {
|
|||
# Remove any wide characters so that WordDecoder can parse
|
||||
# no handler was set here, but that's okay, let's play it safe anyway
|
||||
# https://github.com/MailScanner/v5/issues/253
|
||||
# Also enforce 7 bit characters in filenames
|
||||
my $safefilename = $head->recommended_filename;
|
||||
$safefilename =~ tr/\x00-\xFF/#/c;
|
||||
$safefilename =~ tr/\x00-\x7F/#/c;
|
||||
|
||||
my $fname = mime_to_perl_string $safefilename;
|
||||
|
||||
|
|
|
@ -4263,7 +4263,8 @@ sub BuildFile2EntityAndEntity2File {
|
|||
# Remove any wide characters so that WordDecoder can parse
|
||||
# mime_to_perl_string is ignoring the built-in handler that was set earlier
|
||||
# https://github.com/MailScanner/v5/issues/253
|
||||
$headfile =~ tr/\x00-\xFF/#/c;
|
||||
# Also enforce 7 bit characters for filenames
|
||||
$headfile =~ tr/\x00-\x7F/#/c;
|
||||
|
||||
$headfile = MIME::WordDecoder::mime_to_perl_string($headfile);
|
||||
#print STDERR "headfile is $headfile\n";
|
||||
|
|
Loading…
Reference in a new issue