--- orig/blosxom.cgi 2003-08-26 16:53:56.000000000 -0600 +++ jm3/blosxom.cgi 2006-08-24 20:40:08.000000000 -0600 @@ -146,12 +146,19 @@ # Plugins: Start if ( $plugin_dir and opendir PLUGINS, $plugin_dir ) { - foreach my $plugin ( grep { /^\w+$/ && -f "$plugin_dir/$_" } sort readdir(PLUGINS) ) { + + my @plugs = sort readdir(PLUGINS); + + my $plugin; + foreach( @plugs ) { + $plugin = $_; my($plugin_name, $off) = $plugin =~ /^\d*(\w+?)(_?)$/; my $on_off = $off eq '_' ? -1 : 1; + next unless( $plugin =~ m/^\w*$/ && -f $plugin_dir . "/$plugin"); require "$plugin_dir/$plugin"; $plugin_name->start() and ( $plugins{$plugin_name} = $on_off ) and push @plugins, $plugin_name; - } + } + closedir PLUGINS; }