diff options
author | Eric Wong <e@80x24.org> | 2016-05-19 22:02:56 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-05-19 22:02:56 +0000 |
commit | d6cdb106f27abed5d05da035c95e106939fbe3b2 (patch) | |
tree | 512df7bdbcd4b4f91af64a4ef9d9d645867a072b /lib/PublicInbox/View.pm | |
parent | 9c54a95e5279826fb8a768f7d6b45cc475415f84 (diff) | |
download | public-inbox-d6cdb106f27abed5d05da035c95e106939fbe3b2.tar.gz |
Having a file start with '.' or '-' can be confusing and for users, so do not allow it.
Diffstat (limited to 'lib/PublicInbox/View.pm')
-rw-r--r-- | lib/PublicInbox/View.pm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index ec5f3907..21949812 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -261,7 +261,7 @@ sub attach_link ($$$$) { $desc = $fn unless defined $desc; $desc = '' unless defined $desc; my $sfn; - if (defined $fn && $fn =~ /\A[\w\.-]+[a-zA-Z0-9]\z/) { + if (defined $fn && $fn =~ /\A[[:alnum:]][\w\.-]+[[:alnum:]]\z/) { $sfn = $fn; } elsif ($ct eq 'text/plain') { $sfn = 'a.txt'; |