]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki.pm
Merge branch 'master' of ssh://git.ikiwiki.info/srv/git/ikiwiki.info
[ikiwiki.git] / IkiWiki.pm
index 7553ae3db7c67efc3be926270ba6b35aad27dd0b..c0f5deab60909e825e11d62a85a9fd170ef523df 100644 (file)
@@ -121,7 +121,7 @@ sub getsetup () { #{{{
                type => "internal",
                default => [qw{mdwn link inline htmlscrubber passwordauth
                                openid signinedit lockedit conditional
-                               recentchanges parentlinks}],
+                               recentchanges parentlinks editpage}],
                description => "plugins to enable by default",
                safe => 0,
                rebuild => 1,
@@ -395,6 +395,13 @@ sub getsetup () { #{{{
                safe => 0,
                rebuild => 0,
        },
+       allow_symlinks_before_srcdir => {
+               type => "string",
+               default => 0,
+               description => "allow symlinks in the path leading to the srcdir (potentially insecure)",
+               safe => 0,
+               rebuild => 0,
+       },
 } #}}}
 
 sub defaultconfig () { #{{{
@@ -513,7 +520,11 @@ sub loadplugin ($) { #{{{
        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;
+                       eval { require IkiWiki::Plugin::external };
+                       if ($@) {
+                               my $reason=$@;
+                               error(sprintf(gettext("failed to load external plugin needed for %s plugin: %s"), $plugin, $reason));
+                       }
                        import IkiWiki::Plugin::external "$dir/plugins/$plugin";
                        $loaded_plugins{$plugin}=1;
                        return 1;
@@ -607,7 +618,7 @@ sub pagename ($) { #{{{
 
        my $type=pagetype($file);
        my $page=$file;
-       $page=~s/\Q.$type\E*$// if defined $type;
+       $page=~s/\Q.$type\E*$// if defined $type && !$hooks{htmlize}{$type}{keepextension};
        return $page;
 } #}}}