This way, if an autofile is registered for a file that already exists,
it is remembered that it was tried, and it doesn't get recreated when
removed.
my $pages=shift;
my $del=shift;
my $pages=shift;
my $del=shift;
- if (srcfile($autofile, 1) || file_pruned($autofile)) {
+ if (file_pruned($autofile)) {
my ($file)="$config{srcdir}/$autofile" =~ /$config{wiki_file_regexp}/; # untaint
my ($file)="$config{srcdir}/$autofile" =~ /$config{wiki_file_regexp}/; # untaint
- if (! defined $file || -l $file || -d _ || -e _) {
+ if (! defined $file) {
+ return;
+ }
+
+ # Remember autofiles that were tried, and never try them again later.
+ if (exists $wikistate{$autofiles{$autofile}{plugin}}{autofile}{$autofile}) {
+ $wikistate{$autofiles{$autofile}{plugin}}{autofile}{$autofile}=1;
- if ((!defined $file) ||
- (exists $wikistate{$autofiles{$autofile}{plugin}}{autofile}{$autofile})) {
+ if (srcfile($autofile, 1) || file_pruned($autofile)) {
+ if (-l $file || -d _ || -e _) {
+ return;
+ }
+
my $page = pagename($file);
if ($pages->{$page}) {
return;
my $page = pagename($file);
if ($pages->{$page}) {
return;
}
$autofiles{$autofile}{generator}->();
}
$autofiles{$autofile}{generator}->();
- $wikistate{$autofiles{$autofile}{plugin}}{autofile}{$autofile}=1;
$pages->{$page}=1;
return 1;
}
$pages->{$page}=1;
return 1;
}