diff options
author | Joey Hess <joey@gnu.kitenet.net> | 2009-12-14 17:16:40 -0500 |
---|---|---|
committer | Joey Hess <joey@gnu.kitenet.net> | 2009-12-14 17:16:40 -0500 |
commit | bb1ce7207d9707848dfa7ebf6e32bfff5736732c (patch) | |
tree | 7c423a74bf8d9f260b2570af9987a55a843116b4 /IkiWiki | |
parent | b4bc7d17080055c615bc264c4d5b7d791161682c (diff) | |
download | ikiwiki-bb1ce7207d9707848dfa7ebf6e32bfff5736732c.tar ikiwiki-bb1ce7207d9707848dfa7ebf6e32bfff5736732c.tar.gz |
attachment: Fix several utf-8 problems.
Similar to those in the rename plugin, although here we can't use
the form object.
Diffstat (limited to 'IkiWiki')
-rw-r--r-- | IkiWiki/Plugin/attachment.pm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm index 087c315a9..953e71625 100644 --- a/IkiWiki/Plugin/attachment.pm +++ b/IkiWiki/Plugin/attachment.pm @@ -112,7 +112,7 @@ sub formbuilder (@) { 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 && ($form->submitted eq "Upload Attachment" || $form->submitted eq "Save Page")) { my $session=$params{session}; @@ -189,9 +189,10 @@ sub formbuilder (@) { IkiWiki::saveindex(); } elsif ($form->submitted eq "Insert Links") { - my $page=quotemeta($q->param("page")); + my $page=quotemeta(Encode::decode_utf8($q->param("page"))); my $add=""; foreach my $f ($q->param("attachment_select")) { + $f=Encode::decode_utf8($f); $f=~s/^$page\///; $add.="[[$f]]\n"; } |