unshift @INC, possibly_foolish_untaint($config{libdir});
}
- loadplugin($_) foreach @{$config{plugin}};
+ foreach my $plugin (@{$config{plugin}}) {
+ loadplugin($plugin);
+ }
run_hooks(getopt => sub { shift->() });
if (grep /^-/, @ARGV) {
binmode($in) if ($binary);
return \*$in if $wantfd;
my $ret=<$in>;
+ # check for invalid utf-8, and toss it back to avoid crashes
+ if (! utf8::valid($ret)) {
+ $ret=encode_utf8($ret);
+ }
close $in || error("failed to read $file: $!");
return $ret;
} #}}}
}
if ($absolute) {
- return $config{url}.beautify_urlpath("/".$to);
+ return $config{url}.beautify_url("/".$to);
}
my $link = abs2rel($to, dirname(htmlpage($from)));
my $params=shift;
$params="" if ! defined $params;
- f (length $escape) {
+ if (length $escape) {
return "[[$prefix$command $params]]";
}
elsif (exists $hooks{preprocess}{$command}) {