]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/attachment.pm
allow --dumpsetup to be used w/o specifying srcdir and destdir
[git.ikiwiki.info.git] / IkiWiki / Plugin / attachment.pm
index 8fa330e6d2d07c54b0766b6ba5062b24bef28b68..47e165251376ffa817b014fc041ae1a9cc9aa9d3 100644 (file)
@@ -14,9 +14,8 @@ sub import { #{{{
 
 sub getsetup () { #{{{
        return
-                => {
+               virus_checker => {
                        type => "string",
-                       default => "",
                        example => "clamdscan -",
                        description => "virus checker program (reads STDIN, returns nonzero if virus found)",
                        safe => 0, # executed
@@ -206,8 +205,10 @@ sub formbuilder (@) { #{{{
                IkiWiki::saveindex();
        }
        elsif ($form->submitted eq "Insert Links") {
+               my $page=quotemeta($q->param("page"));
                my $add="";
                foreach my $f ($q->param("attachment_select")) {
+                       $f=~s/^$page\///;
                        $add.="[[$f]]\n";
                }
                $form->field(name => 'editcontent',