about summary refs log tree commit homepage
path: root/lib/PublicInbox/WwwAttach.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-06-04 02:04:27 +0000
committerEric Wong <e@80x24.org>2019-06-04 10:06:18 +0000
commitf8c8ca04d47620d390092000ca09aab071442fac (patch)
treec8289b8facfc88ac8436165a964a9a1f586419ab /lib/PublicInbox/WwwAttach.pm
parentfc483fde5dc78d7e6b230527e375c5f421997565 (diff)
downloadpublic-inbox-f8c8ca04d47620d390092000ca09aab071442fac.tar.gz
AFAIK all names of charsets are ASCII, so passing non-ASCII
characters from emails to clients would probably confuse clients.
Diffstat (limited to 'lib/PublicInbox/WwwAttach.pm')
-rw-r--r--lib/PublicInbox/WwwAttach.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/PublicInbox/WwwAttach.pm b/lib/PublicInbox/WwwAttach.pm
index d690ce41..96103cb0 100644
--- a/lib/PublicInbox/WwwAttach.pm
+++ b/lib/PublicInbox/WwwAttach.pm
@@ -27,7 +27,7 @@ sub get_attach ($$$) {
                 if ($ct && (($ct->{discrete} || '') eq 'text')) {
                         # display all text as text/plain:
                         my $cset = $ct->{attributes}->{charset};
-                        if ($cset && ($cset =~ /\A[\w-]+\z/)) {
+                        if ($cset && ($cset =~ /\A[a-zA-Z0-9_\-]+\z/)) {
                                 $res->[1]->[1] .= qq(; charset=$cset);
                         }
                 } else { # TODO: allow user to configure safe types