deep copy/untaint arrays in setup

master
joey 2006-05-02 04:18:44 +00:00
parent 49fc2283f7
commit fe6b271501
2 changed files with 14 additions and 3 deletions

View File

@ -141,7 +141,7 @@ sub preprocess ($$) { #{{{
return $plugins{preprocess}{$command}->(page => $page, %params); return $plugins{preprocess}{$command}->(page => $page, %params);
} }
else { else {
return "[[bad directive $command]]"; return "[[$command not processed]]";
} }
}; };

View File

@ -28,11 +28,22 @@ sub setup_standard {
gen_wrapper(); gen_wrapper();
} }
%config=(%startconfig); %config=(%startconfig);
delete $config{wrappers};
} }
foreach my $c (keys %setup) { foreach my $c (keys %setup) {
$config{$c}=possibly_foolish_untaint($setup{$c}) if (defined $setup{$c}) {
if defined $setup{$c} && ! ref $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}) { if (! $config{refresh}) {
$config{rebuild}=1; $config{rebuild}=1;
debug("rebuilding wiki.."); debug("rebuilding wiki..");