X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/50e1b43408e85fd2350b9df50e4ceb0c6a495a4f..a18d99c3faee999cb8f23fc5cb7d07bf6670701f:/IkiWiki.pm diff --git a/IkiWiki.pm b/IkiWiki.pm index 5eef40878..a89d9c252 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -146,7 +146,7 @@ sub checkconfig () { #{{{ sub loadplugins () { #{{{ if (defined $config{libdir}) { - unshift @INC, $config{libdir}; + unshift @INC, possibly_foolish_untaint($config{libdir}); } loadplugin($_) foreach @{$config{plugin}}; @@ -166,7 +166,8 @@ sub loadplugin ($) { #{{{ return if grep { $_ eq $plugin} @{$config{disable_plugins}}; - foreach my $dir ($config{libdir}, "$installdir/lib/ikiwiki") { + foreach my $dir (defined $config{libdir} ? possibly_foolish_untaint($config{libdir}) : undef, + "$installdir/lib/ikiwiki") { if (defined $dir && -x "$dir/plugins/$plugin") { require IkiWiki::Plugin::external; import IkiWiki::Plugin::external "$dir/plugins/$plugin"; @@ -1016,7 +1017,9 @@ sub file_pruned ($$) { #{{{ sub gettext { #{{{ # Only use gettext in the rare cases it's needed. - if (exists $ENV{LANG} || exists $ENV{LC_ALL} || exists $ENV{LC_MESSAGES}) { + if ((exists $ENV{LANG} && length $ENV{LANG}) || + (exists $ENV{LC_ALL} && length $ENV{LC_ALL}) || + (exists $ENV{LC_MESSAGES} && length $ENV{LC_MESSAGES})) { if (! $gettext_obj) { $gettext_obj=eval q{ use Locale::gettext q{textdomain};