From d23786cb6c5b3320d4b0c45df3424acea51e90ad Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 11 Jul 2011 21:35:46 -0400 Subject: attachment: Bugfix to create directory when moving attachment out of holding area. --- IkiWiki/Plugin/attachment.pm | 8 +++++--- debian/changelog | 7 +++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm index d8e2f6271..fd4096edf 100644 --- a/IkiWiki/Plugin/attachment.pm +++ b/IkiWiki/Plugin/attachment.pm @@ -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; } diff --git a/debian/changelog b/debian/changelog index 498857cad..6ef9650b9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +ikiwiki (3.20110712) UNRELEASED; urgency=low + + * attachment: Bugfix to create directory when moving attachment out of + holding area. + + -- Joey Hess Mon, 11 Jul 2011 21:35:20 -0400 + ikiwiki (3.20110711) unstable; urgency=low * Add build dep on python-support. Closes: #633536 -- cgit v1.2.3