]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/attachment.pm
attachment: Use relative paths when inserting links.
[ikiwiki.git] / IkiWiki / Plugin / attachment.pm
index 9dbc66020a1455421bae70bf71f4127e3223797e..720078be15cfcd51399f375815b4d22e1a2e8d7b 100644 (file)
@@ -193,8 +193,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',