]> git.deb.at Git - pkg/blosxom.git/blobdiff - blosxom.cgi
Avoid "conditional and" for running plugins "story"
[pkg/blosxom.git] / blosxom.cgi
index 7fff46341709f41d608f3e0a8650911322c4adc2..7dba6352befb8dedb882a345f02c3a17c7eda7c2 100755 (executable)
@@ -449,7 +449,14 @@ sub generate {
     # Plugins: Sort
     # Allow for the first encountered plugin::sort subroutine to override the
     # default built-in sort subroutine
     # 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/;
   
     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
       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
       
       if ($content_type =~ m{\bxml\b}) {
         # Escape <, >, and &, and to produce valid RSS