diff options
author | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-08-26 21:26:54 +0000 |
---|---|---|
committer | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-08-26 21:26:54 +0000 |
commit | 609f48c93cc9017031c11da942a00975c3e7656a (patch) | |
tree | 9835a4ccb75b02195eb9a815bfc63d99bf152532 | |
parent | 92885b87ab23e496d1041c4c03d37ef5658f3d28 (diff) | |
download | ikiwiki-609f48c93cc9017031c11da942a00975c3e7656a.tar ikiwiki-609f48c93cc9017031c11da942a00975c3e7656a.tar.gz |
switch to > n (currently 10) cycle loop protection since eg tumov's include
plugin preprocesses included pages using the name of the including page
-rw-r--r-- | IkiWiki/Render.pm | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index e97f46775..d7f07c08a 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -97,10 +97,10 @@ sub preprocess ($$$) { #{{{ if (length $escape) { return "[[$command $params]]"; } - elsif ($preprocessing{$page}) { + elsif ($preprocessing{$page}++ > 10) { # Avoid loops of preprocessed pages preprocessing # other pages that preprocess them, etc. - return "[[$command would cause preprocessing loop]]"; + return "[[$command preprocessing loop detected]]"; } elsif (exists $hooks{preprocess}{$command}) { # Note: preserve order of params, some plugins may @@ -129,13 +129,12 @@ sub preprocess ($$$) { #{{{ push @params, $val, ''; } } - $preprocessing{$page}=1; my $ret=$hooks{preprocess}{$command}{call}->( @params, page => $page, destpage => $destpage, ); - delete $preprocessing{$page}; + $preprocessing{$page}--; return $ret; } else { |