deep copy/untaint arrays in setup
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Tue, 2 May 2006 04:18:44 +0000 (04:18 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Tue, 2 May 2006 04:18:44 +0000 (04:18 +0000)
IkiWiki/Render.pm
IkiWiki/Setup/Standard.pm

index f9730193b42c26ef3cacfd1eac51cddc73d794be..9ece00157acd0d8c9a8146090648ad68dc0f4c76 100644 (file)
@@ -141,7 +141,7 @@ sub preprocess ($$) { #{{{
                        return $plugins{preprocess}{$command}->(page => $page, %params);
                }
                else {
-                       return "[[bad directive $command]]";
+                       return "[[$command not processed]]";
                }
        };
        
index a13e7805a1c5b8632651ee1b5b8897dffd336944..9883b922a5514da91ce5d820dfe2da2bca148f06 100644 (file)
@@ -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..");