package PublicInbox::WwwAttach; # internal package
use strict;
use warnings;
+use bytes (); # only for bytes::length
use Email::MIME::ContentType qw(parse_content_type);
use PublicInbox::MIME;
use PublicInbox::MsgIter;
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