about summary refs log tree commit homepage
path: root/lib/PublicInbox/View.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/View.pm')
-rw-r--r--lib/PublicInbox/View.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 09afdaf1..1b52bf86 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -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);