]> Sergey Matveev's repositories - public-inbox.git/commitdiff
wwwlisting: fix grep call for match=domain filtering
authorKyle Meyer <kyle@kyleam.com>
Thu, 30 Jul 2020 05:30:55 +0000 (01:30 -0400)
committerEric Wong <e@yhbt.net>
Thu, 30 Jul 2020 07:53:30 +0000 (07:53 +0000)
The grep call in list_match_domain_i returns true for all inboxes,
even ones without a URL that matches the regular expression, because
the qr value passed to grep is not surrounded by slashes.  Add them.

Fixes: 1988d730c0088e8b (config: support multi-value inbox.*.*url)
lib/PublicInbox/WwwListing.pm

index 5f85e3464bc84d9b76986ddedd313cb30347f168..0af0fe68cd7dea676abeec809b23bb3eb1c496d2 100644 (file)
@@ -40,7 +40,7 @@ sub list_all ($$$) {
 sub list_match_domain_i {
        my ($ibx, $arg) = @_;
        my ($list, $hide_key, $re) = @$arg;
 sub list_match_domain_i {
        my ($ibx, $arg) = @_;
        my ($list, $hide_key, $re) = @$arg;
-       if (!$ibx->{-hide}->{$hide_key} && grep($re, @{$ibx->{url}})) {
+       if (!$ibx->{-hide}->{$hide_key} && grep(/$re/, @{$ibx->{url}})) {
                push @$list, $ibx;
        }
 }
                push @$list, $ibx;
        }
 }