From 9f7d9ab356ba81972bf8bed8486a6994fef51667 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 7 Jul 2011 20:32:14 -0400 Subject: Bugfix for trying to attach files to a subpage of the index page. --- IkiWiki/Plugin/attachment.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'IkiWiki/Plugin/attachment.pm') 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; -- cgit v1.2.3