X-Git-Url: https://git.deb.at/?p=pkg%2Fblosxom.git;a=blobdiff_plain;f=blosxom.cgi;h=7dba6352befb8dedb882a345f02c3a17c7eda7c2;hp=7fff46341709f41d608f3e0a8650911322c4adc2;hb=d2e0affcaba618080eaaad930aa2b79bfd899a8d;hpb=ed43f9cbb775f818ea14ed642f9f386a6283c000 diff --git a/blosxom.cgi b/blosxom.cgi index 7fff463..7dba635 100755 --- a/blosxom.cgi +++ b/blosxom.cgi @@ -449,7 +449,14 @@ sub generate { # Plugins: Sort # Allow for the first encountered plugin::sort subroutine to override the # default built-in sort subroutine - my $tmp; foreach my $plugin ( @plugins ) { $plugins{$plugin} > 0 and $plugin->can('sort') and defined($tmp = $plugin->sort()) and $sort = $tmp and last; } + foreach my $plugin (@plugins) { + if ( $plugins{$plugin} > 0 and $plugin->can('sort') ) { + if ( my $tmp = $plugin->sort() ) { + $sort = $tmp; + last; + } + } + } foreach my $path_file ( &$sort(\%f, \%others) ) { last if $ne <= 0 && $date !~ /\d/; @@ -495,7 +502,11 @@ sub generate { my $story = (&$template($path,'story',$flavour)); # Plugins: Story - foreach my $plugin ( @plugins ) { $plugins{$plugin} > 0 and $plugin->can('story') and $entries = $plugin->story($path, $fn, \$story, \$title, \$body) } + foreach my $plugin (@plugins) { + if ( $plugins{$plugin} > 0 and $plugin->can('story') ) { + $entries = $plugin->story( $path, $fn, \$story, \$title, \$body ); + } + } if ($content_type =~ m{\bxml\b}) { # Escape <, >, and &, and to produce valid RSS