]> sipb.mit.edu Git - ikiwiki.git/commitdiff
Bugfix for trying to attach files to a subpage of the index page.
authorJoey Hess <joey@kitenet.net>
Fri, 8 Jul 2011 00:32:14 +0000 (20:32 -0400)
committerJoey Hess <joey@kitenet.net>
Fri, 8 Jul 2011 00:32:14 +0000 (20:32 -0400)
IkiWiki/Plugin/attachment.pm
debian/changelog
doc/bugs/Unable_to_add_attachments_to_some_pages.mdwn

index 4d6dee23e75a2fe4e1f76889b53b19e68483c001..52bac7c1e937ba87e2711ff41319e13a5cfd7814 100644 (file)
@@ -303,8 +303,8 @@ sub attachment_location ($) {
        my $page=shift;
        
        # Put the attachment in a subdir of the page it's attached
        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;
        $page.="/" if length $page;
        
        return $page;
index ece9df882ced98f202a1c8da77a493a365eb6f8e..f51d41c2a841a58e59cf4edeac007c68fcd5b52a 100644 (file)
@@ -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.
     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
 
 
  -- Joey Hess <joeyh@debian.org>  Thu, 09 Jun 2011 10:06:44 -0400
 
index a9255ba3aacd1ae2f2797a176506beb0e3c47fcb..c7fe0bd1553b1945a13b8f6798784b408940b2a5 100644 (file)
@@ -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]]
 >> 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]]