X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/762bf0b887743db0267a50852c2eb3eaa8fb8042..6a64d133526b25b46828bc75c2b3b99c0ab7e331:/IkiWiki/Plugin/attachment.pm?ds=inline diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm index 9dbc66020..47e165251 100644 --- a/IkiWiki/Plugin/attachment.pm +++ b/IkiWiki/Plugin/attachment.pm @@ -6,11 +6,23 @@ use strict; use IkiWiki 2.00; sub import { #{{{ + hook(type => "getsetup", id => "attachment", call => \&getsetup); hook(type => "checkconfig", id => "attachment", call => \&checkconfig); hook(type => "formbuilder_setup", id => "attachment", call => \&formbuilder_setup); hook(type => "formbuilder", id => "attachment", call => \&formbuilder); } # }}} +sub getsetup () { #{{{ + return + virus_checker => { + type => "string", + example => "clamdscan -", + description => "virus checker program (reads STDIN, returns nonzero if virus found)", + safe => 0, # executed + rebuild => 0, + }, +} #}}} + sub check_canattach ($$;$) { #{{{ my $session=shift; my $dest=shift; # where it's going to be put, under the srcdir @@ -193,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',