From d374fdfc010231c1ed0943d397f9792e94683a10 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Sun, 13 Oct 2013 10:23:49 +0000 Subject: [PATCH] Skip channels without factoids in html export --- PBot/Factoids.pm | 4 +++- PBot/VERSION.pm | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/PBot/Factoids.pm b/PBot/Factoids.pm index a91c696b..effa405a 100644 --- a/PBot/Factoids.pm +++ b/PBot/Factoids.pm @@ -125,12 +125,14 @@ sub export_factoids { my $table_id = 1; foreach my $channel (sort keys %{ $self->factoids->hash }) { + next if not scalar keys %{ $self->factoids->hash->{$channel} }; my $chan = $channel eq '.*' ? 'global' : $channel; - print FILE "$chan
\n"; + print FILE "" . encode_entities($chan) . "
\n"; } foreach my $channel (sort keys %{ $self->factoids->hash }) { + next if not scalar keys %{ $self->factoids->hash->{$channel} }; my $chan = $channel eq '.*' ? 'global' : $channel; print FILE "\n"; print FILE "
\n

$chan

\n
\n"; diff --git a/PBot/VERSION.pm b/PBot/VERSION.pm index 94572e13..ce684bf7 100644 --- a/PBot/VERSION.pm +++ b/PBot/VERSION.pm @@ -13,7 +13,7 @@ use warnings; # These are set automatically by the build/commit script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 449, + BUILD_REVISION => 450, BUILD_DATE => "2013-10-13", };