aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2009-12-14 17:01:55 -0500
committerJoey Hess <joey@gnu.kitenet.net>2009-12-14 17:15:50 -0500
commitb4bc7d17080055c615bc264c4d5b7d791161682c (patch)
tree4fa160deb7258cec44e35470264eb5ff2d649d8f
parent3f90eba5a1a5df95f2c9f7fc2d78a382731f2d10 (diff)
downloadikiwiki-b4bc7d17080055c615bc264c4d5b7d791161682c.tar
ikiwiki-b4bc7d17080055c615bc264c4d5b7d791161682c.tar.gz
rename: Fix some utf-8 problems.
The crux of the problem is that the cgi object has raw values not converted to utf-8, and rename was using its fields. Also fixed a missed place where the form object did not get its fields utf-8 encoded.
-rw-r--r--IkiWiki/Plugin/rename.pm9
-rw-r--r--debian/changelog1
2 files changed, 6 insertions, 4 deletions
diff --git a/IkiWiki/Plugin/rename.pm b/IkiWiki/Plugin/rename.pm
index c3e03496f..8213d21f6 100644
--- a/IkiWiki/Plugin/rename.pm
+++ b/IkiWiki/Plugin/rename.pm
@@ -235,6 +235,7 @@ sub formbuilder (@) {
if (defined $form->field("do") && ($form->field("do") eq "edit" ||
$form->field("do") eq "create")) {
+ IkiWiki::decode_form_utf8($form);
my $q=$params{cgi};
my $session=$params{session};
@@ -242,7 +243,7 @@ sub formbuilder (@) {
rename_start($q, $session, 0, $form->field("page"));
}
elsif ($form->submitted eq "Rename Attachment") {
- my @selected=$q->param("attachment_select");
+ my @selected=map { Encode::decode_utf8($_) } $q->param("attachment_select");
if (@selected > 1) {
error(gettext("Only one attachment can be renamed at a time."));
}
@@ -278,7 +279,7 @@ sub sessioncgi ($$) {
if ($q->param("do") eq 'rename') {
my $session=shift;
- my ($form, $buttons)=rename_form($q, $session, $q->param("page"));
+ my ($form, $buttons)=rename_form($q, $session, Encode::decode_utf8($q->param("page")));
IkiWiki::decode_form_utf8($form);
if ($form->submitted eq 'Cancel') {
@@ -290,9 +291,9 @@ sub sessioncgi ($$) {
# These untaints are safe because of the checks
# performed in check_canrename later.
- my $src=$q->param("page");
+ my $src=$form->field("page");
my $srcfile=IkiWiki::possibly_foolish_untaint($pagesources{$src});
- my $dest=IkiWiki::possibly_foolish_untaint(titlepage($q->param("new_name")));
+ my $dest=IkiWiki::possibly_foolish_untaint(titlepage($form->field("new_name")));
my $destfile=$dest;
if (! $q->param("attachment")) {
my $type=$q->param('type');
diff --git a/debian/changelog b/debian/changelog
index 491e07a4a..41f4ec870 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,7 @@ ikiwiki (3.20091203) UNRELEASED; urgency=low
* Improve javascript onload handling.
* monotone: Deal with format change in version 0.45.
(Thanks, Richard Levitte)
+ * rename: Fix some utf-8 problems.
-- Joey Hess <joeyh@debian.org> Wed, 02 Dec 2009 17:22:21 -0500