]> Sergey Matveev's repositories - public-inbox.git/commitdiff
newswww: only accept ASCII digits as article numbers
authorEric Wong <e@80x24.org>
Tue, 4 Jun 2019 02:04:30 +0000 (02:04 +0000)
committerEric Wong <e@80x24.org>
Tue, 4 Jun 2019 10:06:18 +0000 (10:06 +0000)
Non-ASCII digits aren't specified in RFC3977 for article numbers;
so don't waste a trip to SQLite only to turn up empty.

lib/PublicInbox/NewsWWW.pm

index 8626cf96eaba44acee92a10a2aa3d84fcb7ab788..80bb488622f41095fc619bdcc5ee0b5682513ffe 100644 (file)
@@ -47,7 +47,7 @@ sub call {
        if (my $ibx = $pi_config->lookup_newsgroup($ng)) {
                my $url = PublicInbox::Hval::prurl($env, $ibx->{url});
                my $code = 301;
-               if (defined $article && $article =~ /\A\d+\z/) {
+               if (defined $article && $article =~ /\A[0-9]+\z/) {
                        my $mid = eval { $ibx->mm->mid_for($article) };
                        if (defined $mid) {
                                # article IDs are not stable across clones,