X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fupstream%2Fblosxom.git;a=blobdiff_plain;f=blosxom.cgi;h=f4666d06e90dc5b73121862d0336f6b495a804e6;hp=2c6b6ee17d1e7e5692668cba4f5be2d3297ff4dd;hb=d6ed37922ac9f1f8dffc136bbcf6618c3b74a03d;hpb=2e7cf5294e63848b2f862b9ce828d54994a7ab52 diff --git a/blosxom.cgi b/blosxom.cgi index 2c6b6ee..f4666d0 100755 --- a/blosxom.cgi +++ b/blosxom.cgi @@ -317,7 +317,14 @@ $entries = # Plugins: Entries # Allow for the first encountered plugin::entries subroutine to override the # default built-in entries subroutine -my $tmp; foreach my $plugin ( @plugins ) { $plugins{$plugin} > 0 and $plugin->can('entries') and defined($tmp = $plugin->entries()) and $entries = $tmp and last; } +foreach my $plugin (@plugins) { + if ( $plugins{$plugin} > 0 and $plugin->can('entries') ) { + if ( my $tmp = $plugin->entries() ) { + $entries = $tmp; + last; + } + } +} my ($files, $indexes, $others) = &$entries(); %indexes = %$indexes; @@ -383,7 +390,9 @@ sub generate { %files = %$files; %others = ref $others ? %$others : (); # Plugins: Filter - foreach my $plugin ( @plugins ) { $plugins{$plugin} > 0 and $plugin->can('filter') and $entries = $plugin->filter(\%files, \%others) } + foreach my $plugin ( @plugins ) { + if ($plugins{$plugin} > 0 and $plugin->can('filter')){ $entries = $plugin->filter(\%files, \%others); } + } my %f = %files;