]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
attachment: Bugfix to create directory when moving attachment out of holding area.
authorJoey Hess <joey@kitenet.net>
Tue, 12 Jul 2011 01:35:46 +0000 (21:35 -0400)
committerJoey Hess <joey@kitenet.net>
Tue, 12 Jul 2011 01:35:46 +0000 (21:35 -0400)
IkiWiki/Plugin/attachment.pm
debian/changelog

index d8e2f627150e62bdaa4c4ed80a80bb8731f971bb..fd4096edf7de153ef01145f310c459f255e3fffc 100644 (file)
@@ -273,11 +273,13 @@ sub attachments_save {
        my $dir=attachment_holding_location($form->field('page'));
        foreach my $filename (glob("$dir/*")) {
                next unless -f $filename;
-               my $dest=$config{srcdir}."/".
+               my $destdir=$config{srcdir}."/".
                        linkpage(IkiWiki::possibly_foolish_untaint(
-                               attachment_location($form->field('page')))).
-                       IkiWiki::basename($filename);
+                               attachment_location($form->field('page'))));
+               my $destfile=IkiWiki::basename($filename);
+               my $dest=$destdir.$destfile;
                unlink($dest);
+               IkiWiki::prep_writefile($destfile, $destdir);
                rename($filename, $dest);
                push @attachments, $dest;
        }
index 498857cad3d15452dd90573b4f733060053d8a82..6ef9650b96b35292d558c1c8a82e5fb9899c0938 100644 (file)
@@ -1,3 +1,10 @@
+ikiwiki (3.20110712) UNRELEASED; urgency=low
+
+  * attachment: Bugfix to create directory when moving attachment out of 
+    holding area.
+
+ -- Joey Hess <joeyh@debian.org>  Mon, 11 Jul 2011 21:35:20 -0400
+
 ikiwiki (3.20110711) unstable; urgency=low
 
   * Add build dep on python-support. Closes: #633536