From a5da709e3ad00c68552098c2b2f41b87f75f65cb Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 16 Sep 2024 21:02:58 +0000 Subject: [PATCH] config: ignore blank address= and listid= entries At the minimum, there must be a non-space character in address= and listid= entries for matches to occur. Filter out the obviously unmatchable entries here to avoid potential problems elsewhere. --- lib/PublicInbox/Config.pm | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/PublicInbox/Config.pm b/lib/PublicInbox/Config.pm index cda3045e6..d76deca40 100644 --- a/lib/PublicInbox/Config.pm +++ b/lib/PublicInbox/Config.pm @@ -492,16 +492,14 @@ sub _fill_ibx { ($ibx->{name}) = keys %dedupe; # used as a key everywhere $ibx->{-pi_cfg} = $self; $ibx = PublicInbox::Inbox->new($ibx); - foreach (@{$ibx->{address}}) { + for (grep /\S/, @{$ibx->{address}}) { my $lc_addr = lc($_); $self->{-by_addr}->{$lc_addr} = $ibx; $self->{-no_obfuscate}->{$lc_addr} = 1; } - if (my $listids = $ibx->{listid}) { - # RFC2919 section 6 stipulates "case insensitive equality" - foreach my $list_id (@$listids) { - $self->{-by_list_id}->{lc($list_id)} = $ibx; - } + # RFC2919 section 6 stipulates "case insensitive equality" + for my $list_id (grep /\S/, @{$ibx->{listid} // []}) { + $self->{-by_list_id}->{lc($list_id)} = $ibx; } if (defined(my $ngname = $ibx->{newsgroup})) { if (ref($ngname)) { -- 2.47.2