mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-26 05:49:27 +01:00
Plugins/Spinach.pm: ensure category filters have content before applying
This commit is contained in:
parent
af99023160
commit
d26be547c2
@ -1654,13 +1654,13 @@ sub choosecategory {
|
||||
my @choices;
|
||||
my @categories;
|
||||
|
||||
if (exists $self->{metadata}->{hash}->{filter}->{category_include_filter}) {
|
||||
if (exists $self->{metadata}->{hash}->{filter}->{category_include_filter} and length $self->{metadata}->{hash}->{filter}->{category_include_filter}) {
|
||||
@categories = grep { /$self->{metadata}->{hash}->{filter}->{category_include_filter}/i } keys %{$self->{categories}};
|
||||
} else {
|
||||
@categories = keys %{$self->{categories}};
|
||||
}
|
||||
|
||||
if (exists $self->{metadata}->{hash}->{filter}->{category_exclude_filter}) {
|
||||
if (exists $self->{metadata}->{hash}->{filter}->{category_exclude_filter} and length $self->{metadata}->{hash}->{filter}->{category_exclude_filter}) {
|
||||
@categories = grep { $_ !~ /$self->{metadata}->{hash}->{filter}->{category_exclude_filter}/i } @categories;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user