]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/View.pm
run update-copyrights from gnulib for 2019
[public-inbox.git] / lib / PublicInbox / View.pm
index 09afdaf1bd15aa728766eb3104ff32d43057567c..aeb32fc8db88d5787c48f415be7d3e941b799b56 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2014-2018 all contributors <meta@public-inbox.org>
+# Copyright (C) 2014-2019 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 #
 # 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);