]> sipb.mit.edu Git - ikiwiki.git/blob - doc/bugs/preprocessing_loop_control_too_tight.mdwn
Merge branch 'ready/postform-no'
[ikiwiki.git] / doc / bugs / preprocessing_loop_control_too_tight.mdwn
1 the preprocessing hook makes sure that no infinite loops occur by restricting the depth of nested directives to 3.
2
3 this is insufficient in some situations in which sidebars are conditionally assembled from templates.
4
5 given there are no limits on the number of directives per page and the number of edits a user can do in a particular time frame, i assume that raising that limit slightly won't make the DoS attacks that can be done against ikiwiki too much worse.
6
7 i'd like to suggest 8 as a new value for recursion depth limit. most people can wrap their minds around a depth 3 nested directive setup, but when you reach a depth of 8, it's likely to be easier to write a dedicated plugin.
8
9 <code><pre>
10 diff --git a/IkiWiki.pm b/IkiWiki.pm
11 index 75c9579..ad0f8b0 100644
12 --- a/IkiWiki.pm
13 +++ b/IkiWiki.pm
14 @@ -1487 +1487 @@ sub preprocess ($$$;$$) {
15 -                       if ($preprocessing{$page}++ > 3) {
16 +                       if ($preprocessing{$page}++ > 8) {
17 </pre></code>
18
19 [[!tag patch]]
20
21 > [[Seems reasonable|users/smcv/ready]] --smcv
22
23 >> [[done]] --[[Joey]]