summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-07-25 19:22:29 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-07-25 19:22:29 -0400
commitb7bf566f55ec844a1d472b2efb8a2863638aacdc (patch)
treef02359b11ba7d13868c49bf93972ebf4e8a7f7fe
parenta71b9a1cf1322cd1423971483969d37efa5ebcf8 (diff)
attachment: Use relative paths when inserting links.
-rw-r--r--IkiWiki/Plugin/attachment.pm2
-rw-r--r--debian/changelog1
2 files changed, 3 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm
index 9dbc66020..720078be1 100644
--- a/IkiWiki/Plugin/attachment.pm
+++ b/IkiWiki/Plugin/attachment.pm
@@ -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',
diff --git a/debian/changelog b/debian/changelog
index 7df588174..348d30997 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -28,6 +28,7 @@ ikiwiki (2.55) UNRELEASED; urgency=low
* monotone: Add support for rename, delete, and also diff. (William Uther)
* toggle: Fix incompatability between javascript and webkit.
* bzr: Add support for rename and delete. (Jelmer Vernooij)
+ * attachment: Use relative paths when inserting links.
-- Joey Hess <joeyh@debian.org> Mon, 21 Jul 2008 11:35:46 -0400