From fe6b271501d4d8ae00a012d14a8814cee5e0e55d Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 2 May 2006 04:18:44 +0000 Subject: [PATCH] deep copy/untaint arrays in setup --- IkiWiki/Render.pm | 2 +- IkiWiki/Setup/Standard.pm | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index f9730193b..9ece00157 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -141,7 +141,7 @@ sub preprocess ($$) { #{{{ return $plugins{preprocess}{$command}->(page => $page, %params); } else { - return "[[bad directive $command]]"; + return "[[$command not processed]]"; } }; diff --git a/IkiWiki/Setup/Standard.pm b/IkiWiki/Setup/Standard.pm index a13e7805a..9883b922a 100644 --- a/IkiWiki/Setup/Standard.pm +++ b/IkiWiki/Setup/Standard.pm @@ -28,11 +28,22 @@ sub setup_standard { gen_wrapper(); } %config=(%startconfig); + delete $config{wrappers}; } foreach my $c (keys %setup) { - $config{$c}=possibly_foolish_untaint($setup{$c}) - if defined $setup{$c} && ! ref $setup{$c}; + if (defined $setup{$c}) { + if (! ref $setup{$c}) { + $config{$c}=possibly_foolish_untaint($setup{$c}); + } + elsif (ref $setup{$c} eq 'ARRAY') { + $config{$c}=[map { possibly_foolish_untaint($_) } @{$setup{$c}}] + } + } + else { + $config{$c}=undef; + } } + if (! $config{refresh}) { $config{rebuild}=1; debug("rebuilding wiki.."); -- 2.39.2