]> git.deb.at Git - pkg/blosxom.git/blobdiff - blosxom.cgi
Avoid "conditional and" for running plugins "end"
[pkg/blosxom.git] / blosxom.cgi
index 2e87b759c77a8acbaebd1749e6cf1215df584858..7d1daef0b598073b65a05ab06be62f13c31b029e 100755 (executable)
@@ -258,7 +258,14 @@ shift @INC foreach @plugin_dirs;
 # Plugins: Template
 # Allow for the first encountered plugin::template subroutine to override the
 # default built-in template subroutine
-my $tmp; foreach my $plugin ( @plugins ) { $plugins{$plugin} > 0 and $plugin->can('template') and defined($tmp = $plugin->template()) and $template = $tmp and last; }
+foreach my $plugin (@plugins) {
+    if ( $plugins{$plugin} > 0 and $plugin->can('template') ) {
+        if ( my $tmp = $plugin->template() ) {
+            $template = $tmp;
+            last;
+        }
+    }
+}
 
 # Provide backward compatibility for Blosxom < 2.0rc1 plug-ins
 sub load_template {
@@ -381,7 +388,11 @@ else {
 }
 
 # Plugins: End
-foreach my $plugin ( @plugins ) { $plugins{$plugin} > 0 and $plugin->can('end') and $entries = $plugin->end() }
+foreach my $plugin (@plugins) {
+    if ( $plugins{$plugin} > 0 and $plugin->can('end') ) {
+        $entries = $plugin->end();
+    }
+}
 
 # Generate 
 sub generate {
@@ -515,7 +526,10 @@ sub generate {
   
       $date = &$interpolate($date);
   
-      $curdate ne $date and $curdate = $date and $output .= $date;
+      if ( $date && $curdate ne $date ) {
+          $curdate = $date;
+          $output .= $date;
+      }
       
       use vars qw/ $title $body $raw /;
       if (-f "$path_file" && $fh->open("< $path_file")) {