attachment: Fix several utf-8 problems.

Similar to those in the rename plugin, although here we can't use
the form object.
master
Joey Hess 2009-12-14 17:16:40 -05:00
parent b4bc7d1708
commit bb1ce7207d
2 changed files with 4 additions and 2 deletions

View File

@ -112,7 +112,7 @@ sub formbuilder (@) {
return if ! defined $form->field("do") || ($form->field("do") ne "edit" && $form->field("do") ne "create") ; return if ! defined $form->field("do") || ($form->field("do") ne "edit" && $form->field("do") ne "create") ;
my $filename=$q->param('attachment'); my $filename=Encode::decode_utf8($q->param('attachment'));
if (defined $filename && length $filename && if (defined $filename && length $filename &&
($form->submitted eq "Upload Attachment" || $form->submitted eq "Save Page")) { ($form->submitted eq "Upload Attachment" || $form->submitted eq "Save Page")) {
my $session=$params{session}; my $session=$params{session};
@ -189,9 +189,10 @@ sub formbuilder (@) {
IkiWiki::saveindex(); IkiWiki::saveindex();
} }
elsif ($form->submitted eq "Insert Links") { elsif ($form->submitted eq "Insert Links") {
my $page=quotemeta($q->param("page")); my $page=quotemeta(Encode::decode_utf8($q->param("page")));
my $add=""; my $add="";
foreach my $f ($q->param("attachment_select")) { foreach my $f ($q->param("attachment_select")) {
$f=Encode::decode_utf8($f);
$f=~s/^$page\///; $f=~s/^$page\///;
$add.="[[$f]]\n"; $add.="[[$f]]\n";
} }

1
debian/changelog vendored
View File

@ -7,6 +7,7 @@ ikiwiki (3.20091203) UNRELEASED; urgency=low
* monotone: Deal with format change in version 0.45. * monotone: Deal with format change in version 0.45.
(Thanks, Richard Levitte) (Thanks, Richard Levitte)
* rename: Fix some utf-8 problems. * rename: Fix some utf-8 problems.
* attachment: Fix several utf-8 problems.
-- Joey Hess <joeyh@debian.org> Wed, 02 Dec 2009 17:22:21 -0500 -- Joey Hess <joeyh@debian.org> Wed, 02 Dec 2009 17:22:21 -0500