aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/CGI.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2009-12-14 18:16:47 -0500
committerJoey Hess <joey@gnu.kitenet.net>2009-12-14 18:16:47 -0500
commit2bceb10b5fd06e8e0867cbc6d72a16cbaae35803 (patch)
treee0ce6d985864e7f1db28c0b795c13b417bd54b9c /IkiWiki/CGI.pm
parent40078b1781c47228358fd193733d82f0429566eb (diff)
downloadikiwiki-2bceb10b5fd06e8e0867cbc6d72a16cbaae35803.tar
ikiwiki-2bceb10b5fd06e8e0867cbc6d72a16cbaae35803.tar.gz
404/goto: Fix 404 display of utf-8 pages.
Problem here was that no charset http header was being sent. I fixed this globally by making cgi_custom_failure send the header. Required changing its parameters.
Diffstat (limited to 'IkiWiki/CGI.pm')
-rw-r--r--IkiWiki/CGI.pm12
1 files changed, 8 insertions, 4 deletions
diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm
index 9277223f0..866711a71 100644
--- a/IkiWiki/CGI.pm
+++ b/IkiWiki/CGI.pm
@@ -235,11 +235,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 +278,7 @@ sub check_banned ($$) {
$session->delete();
cgi_savesession($session);
cgi_custom_failure(
- $q->header(-status => "403 Forbidden"),
+ $q, "403 Forbidden",
gettext("You are banned."));
}
}