aboutsummaryrefslogtreecommitdiff
path: root/mail
diff options
context:
space:
mode:
Diffstat (limited to 'mail')
-rw-r--r--mail/p5-MIME-Tools/files/patch-Filer.pm-whitespace23
1 files changed, 23 insertions, 0 deletions
diff --git a/mail/p5-MIME-Tools/files/patch-Filer.pm-whitespace b/mail/p5-MIME-Tools/files/patch-Filer.pm-whitespace
new file mode 100644
index 000000000000..e011a0b7f4ed
--- /dev/null
+++ b/mail/p5-MIME-Tools/files/patch-Filer.pm-whitespace
@@ -0,0 +1,23 @@
+--- lib/MIME/Parser/Filer.pm Thu Nov 23 06:04:03 2000
++++ lib/MIME/Parser/Filer.pm Thu Aug 26 00:42:18 2004
+@@ -357,8 +357,9 @@
+ $self->debug("is this evil? '$name'");
+
+ return 1 if (!defined($name) or ($name eq '')); ### empty
++ return 1 if ($name =~ m{(^\s)|(\s+\Z)}); ### leading/trailing whitespace
+ return 1 if ($name =~ m{^\.+\Z}); ### dots
+- return 1 if ($name =~ tr{\\/:[]}{}); ### path characters
++ return 1 if ($name =~ /((?:[\[\]\\\/\<\>\|\?\*\:\"]|\p{IsCntrl}))/); ### path or special characters
+ return 1 if ($self->{MPF_MaxName} and
+ (length($name) > $self->{MPF_MaxName}));
+
+@@ -402,6 +403,9 @@
+ my ($root, $ext) = (($last =~ /^(.*)\.([^\.]+)\Z/)
+ ? ($1, $2)
+ : ($last, ''));
++ ### Delete leading and trailing whitespace
++ $root =~ s/^\s+//;
++ $ext =~ s/\s+$//;
+ $root = substr($root, 0, ($self->{MPF_TrimRoot} || 14));
+ $ext = substr($ext, 0, ($self->{MPF_TrimExt} || 3));
+ $ext =~ /^\w+$/ or $ext = "dat";