X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FView.pm;h=aeb32fc8db88d5787c48f415be7d3e941b799b56;hb=9bd675d33ad1e49bd2ebe12a1d216216e61380de;hp=09afdaf1bd15aa728766eb3104ff32d43057567c;hpb=e220b8b2ee5cfd458167dc2c6c92726352c4c80e;p=public-inbox.git diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 09afdaf1..aeb32fc8 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -1,4 +1,4 @@ -# Copyright (C) 2014-2018 all contributors +# Copyright (C) 2014-2019 all contributors # License: AGPL-3.0+ # # Used for displaying the HTML web interface. @@ -528,7 +528,7 @@ sub attach_link ($$$$;$) { $desc = $fn unless defined $desc; $desc = '' unless defined $desc; my $sfn; - if (defined $fn && $fn =~ /\A[[:alnum:]][\w\.-]+[[:alnum:]]\z/) { + if (defined $fn && $fn =~ /\A$PublicInbox::Hval::FN\z/o) { $sfn = $fn; } elsif ($ct eq 'text/plain') { $sfn = 'a.txt'; @@ -1160,8 +1160,8 @@ sub paginate_recent ($$) { # Xapian uses '..' but '-' is perhaps friendier to URL linkifiers # if only $after exists "YYYYMMDD.." because "." could be skipped # if interpreted as an end-of-sentence - $t =~ s/\A(\d{8,14})-// and $after = str2ts($1); - $t =~ /\A(\d{8,14})\z/ and $before = str2ts($1); + $t =~ s/\A([0-9]{8,14})-// and $after = str2ts($1); + $t =~ /\A([0-9]{8,14})\z/ and $before = str2ts($1); my $ibx = $ctx->{-inbox}; my $msgs = $ibx->recent($opts, $after, $before);