]> sipb.mit.edu Git - ikiwiki.git/commitdiff
make decode_form_utf8 safe for arrays
authorJoey Hess <joey@gnu.kitenet.net>
Sat, 9 Jan 2010 21:07:01 +0000 (16:07 -0500)
committerJoey Hess <joey@gnu.kitenet.net>
Sat, 9 Jan 2010 21:07:01 +0000 (16:07 -0500)
IkiWiki/CGI.pm

index 866711a719478cd7bde8a0fb8ecdfc44e8678ef9..cd4a5574ce9b9d1239b87a4329c41c4dc1871290 100644 (file)
@@ -65,8 +65,9 @@ sub decode_form_utf8 ($) {
        if ($] >= 5.01) {
                my $form = shift;
                foreach my $f ($form->field) {
        if ($] >= 5.01) {
                my $form = shift;
                foreach my $f ($form->field) {
+                       my @value=map { decode_utf8($_) } $form->field($f);
                        $form->field(name  => $f,
                        $form->field(name  => $f,
-                                    value => decode_utf8($form->field($f)),
+                                    value => \@value,
                                     force => 1,
                        );
                }
                                     force => 1,
                        );
                }