mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-26 13:59:47 +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 @choices;
|
||||||
my @categories;
|
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}};
|
@categories = grep { /$self->{metadata}->{hash}->{filter}->{category_include_filter}/i } keys %{$self->{categories}};
|
||||||
} else {
|
} else {
|
||||||
@categories = keys %{$self->{categories}};
|
@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;
|
@categories = grep { $_ !~ /$self->{metadata}->{hash}->{filter}->{category_exclude_filter}/i } @categories;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user