From ba6f3d8379fb9ee8d0f18e3e0d6d77386daf79c9 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 27 Mar 2021 23:22:38 +0000 Subject: lei mark: relax label requirements It seems safe to use ALLCAPS labels like "INBOX" with Xapian. We'll also allow single-character labels. --- lib/PublicInbox/LeiMark.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/PublicInbox/LeiMark.pm') diff --git a/lib/PublicInbox/LeiMark.pm b/lib/PublicInbox/LeiMark.pm index 6d236411..34846b84 100644 --- a/lib/PublicInbox/LeiMark.pm +++ b/lib/PublicInbox/LeiMark.pm @@ -23,7 +23,7 @@ my %ERR = ( my ($label) = @_; length($label) >= $L_MAX and return "`$label' too long (must be <= $L_MAX)"; - $label =~ m{\A[a-z0-9_][a-z0-9_\-\./\@,]*[a-z0-9]\z} ? + $label =~ m{\A[a-z0-9_](?:[a-z0-9_\-\./\@,]*[a-z0-9])?\z}i ? undef : "`$label' is invalid"; }, kw => sub { -- cgit v1.2.3-24-ge0c7