Fix committing attachments when using svn.
parent
9710d98978
commit
87f46582f5
|
@ -274,15 +274,15 @@ sub attachments_save {
|
||||||
foreach my $filename (glob("$dir/*")) {
|
foreach my $filename (glob("$dir/*")) {
|
||||||
$filename=Encode::decode_utf8($filename);
|
$filename=Encode::decode_utf8($filename);
|
||||||
next unless -f $filename;
|
next unless -f $filename;
|
||||||
my $destdir=$config{srcdir}."/".
|
my $destdir=linkpage(IkiWiki::possibly_foolish_untaint(
|
||||||
linkpage(IkiWiki::possibly_foolish_untaint(
|
|
||||||
attachment_location($form->field('page'))));
|
attachment_location($form->field('page'))));
|
||||||
|
my $absdestdir=$config{srcdir}."/".$destdir;
|
||||||
my $destfile=IkiWiki::basename($filename);
|
my $destfile=IkiWiki::basename($filename);
|
||||||
my $dest=$destdir.$destfile;
|
my $dest=$absdestdir.$destfile;
|
||||||
unlink($dest);
|
unlink($dest);
|
||||||
IkiWiki::prep_writefile($destfile, $destdir);
|
IkiWiki::prep_writefile($destfile, $absdestdir);
|
||||||
rename($filename, $dest);
|
rename($filename, $dest);
|
||||||
push @attachments, $dest;
|
push @attachments, $destdir.$destfile;
|
||||||
}
|
}
|
||||||
return unless @attachments;
|
return unless @attachments;
|
||||||
require IkiWiki::Render;
|
require IkiWiki::Render;
|
||||||
|
|
|
@ -10,3 +10,9 @@ From this code it looks like $dest needs to be absolute and that a relative path
|
||||||
push @attachments, $dest;
|
push @attachments, $dest;
|
||||||
|
|
||||||
I'm using ikiwiki version 3.20120202ubuntu1.
|
I'm using ikiwiki version 3.20120202ubuntu1.
|
||||||
|
|
||||||
|
> I don't think this affects git, just because it happens to
|
||||||
|
> allow adding with an absolute path.
|
||||||
|
>
|
||||||
|
> So, this is an interesting way svn support can bit rot if nothing
|
||||||
|
> is testing it! [[fixed|done]] --[[Joey]]
|
||||||
|
|
Loading…
Reference in New Issue