]> Sergey Matveev's repositories - public-inbox.git/commitdiff
inbox: require ASCII digits for feedmax var
authorEric Wong <e@80x24.org>
Tue, 4 Jun 2019 08:29:36 +0000 (08:29 +0000)
committerEric Wong <e@80x24.org>
Tue, 4 Jun 2019 10:06:18 +0000 (10:06 +0000)
Don't waste more cycles than necessary if somebody decides to
put non-ASCII digits in their ~/.public-inbox/config

lib/PublicInbox/Inbox.pm

index b3178b987a7a031dc96d134fa7be13423fda1866..04d2f83209851989f402b7161da3b7bb494b2e53 100644 (file)
@@ -74,7 +74,7 @@ sub _set_uint ($$$) {
        my $val = $opts->{$field};
        if (defined $val) {
                $val = $val->[-1] if ref($val) eq 'ARRAY';
-               $val = undef if $val !~ /\A\d+\z/;
+               $val = undef if $val !~ /\A[0-9]+\z/;
        }
        $opts->{$field} = $val || $default;
 }