X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/ce785c87022842a53eda6a25088eb4299907f938..9dbeb003df73ff04fe608558004a6bfe4e3eaf78:/IkiWiki/CGI.pm?ds=inline diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index 9277223f0..cd4a5574c 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -65,8 +65,9 @@ sub decode_form_utf8 ($) { if ($] >= 5.01) { my $form = shift; foreach my $f ($form->field) { + my @value=map { decode_utf8($_) } $form->field($f); $form->field(name => $f, - value => decode_utf8($form->field($f)), + value => \@value, force => 1, ); } @@ -235,11 +236,15 @@ sub cgi_prefs ($$) { showform($form, $buttons, $session, $q); } -sub cgi_custom_failure ($$) { - my $header=shift; +sub cgi_custom_failure ($$$) { + my $q=shift; + my $httpstatus=shift; my $message=shift; - print $header; + print $q->header( + -status => $httpstatus, + -charset => 'utf-8', + ); print $message; # Internet Explod^Hrer won't show custom 404 responses @@ -274,7 +279,7 @@ sub check_banned ($$) { $session->delete(); cgi_savesession($session); cgi_custom_failure( - $q->header(-status => "403 Forbidden"), + $q, "403 Forbidden", gettext("You are banned.")); } }