aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/attachment.pm
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 /IkiWiki/Plugin/attachment.pm
parent786afc42e09d6bf52166608c230a9a77025fbf56 (diff)
downloadikiwiki-9f7d9ab356ba81972bf8bed8486a6994fef51667.tar
ikiwiki-9f7d9ab356ba81972bf8bed8486a6994fef51667.tar.gz
Bugfix for trying to attach files to a subpage of the index page.
Diffstat (limited to 'IkiWiki/Plugin/attachment.pm')
-rw-r--r--IkiWiki/Plugin/attachment.pm4
1 files changed, 2 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;