aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2011-07-07 20:32:14 -0400
committerJoey Hess <joey@kitenet.net>2011-07-07 20:32:14 -0400
commit9f7d9ab356ba81972bf8bed8486a6994fef51667 (patch)
tree364eb8326a48b6a79696f26196cca8a001c2c42b
parent786afc42e09d6bf52166608c230a9a77025fbf56 (diff)
downloadikiwiki-9f7d9ab356ba81972bf8bed8486a6994fef51667.tar
ikiwiki-9f7d9ab356ba81972bf8bed8486a6994fef51667.tar.gz
Bugfix for trying to attach files to a subpage of the index page.
-rw-r--r--IkiWiki/Plugin/attachment.pm4
-rw-r--r--debian/changelog1
-rw-r--r--doc/bugs/Unable_to_add_attachments_to_some_pages.mdwn5
3 files changed, 8 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm
index 4d6dee23e..52bac7c1e 100644
--- a/IkiWiki/Plugin/attachment.pm
+++ b/IkiWiki/Plugin/attachment.pm
@@ -303,8 +303,8 @@ sub attachment_location ($) {
my $page=shift;
# Put the attachment in a subdir of the page it's attached
- # to, unless that page is an "index" page.
- $page=~s/(^|\/)index//;
+ # to, unless that page is the "index" page.
+ return "" if $page eq 'index';
$page.="/" if length $page;
return $page;
diff --git a/debian/changelog b/debian/changelog
index ece9df882..f51d41c2a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -31,6 +31,7 @@ ikiwiki (3.20110609) UNRELEASED; urgency=low
markdown when forcing urls absolute.
* Bugfix for wikilink containing an email address not showing up in
brokenlinks list.
+ * Bugfix for trying to attach files to a subpage of the index page.
-- Joey Hess <joeyh@debian.org> Thu, 09 Jun 2011 10:06:44 -0400
diff --git a/doc/bugs/Unable_to_add_attachments_to_some_pages.mdwn b/doc/bugs/Unable_to_add_attachments_to_some_pages.mdwn
index a9255ba3a..c7fe0bd15 100644
--- a/doc/bugs/Unable_to_add_attachments_to_some_pages.mdwn
+++ b/doc/bugs/Unable_to_add_attachments_to_some_pages.mdwn
@@ -24,3 +24,8 @@ Please advise.
>> I dont have an `allowed_attachments` section in my setup file
>> But I've set an `allowed_attachments` like `allowed_attachments => 'maxsize(40000kb) and mimetype(*)',` and I still get the error.
>> Thanks --[[aland]]
+
+>>> Being the subpage of index is the problem. It's not usual to have
+>>> any other page as a subpage of index; as there's really no reason to do
+>>> that, so some code broke in that special case. [[fixed|done]]
+>>> --[[Joey]]