diff options
author | Joey Hess <joey@gnu.kitenet.net> | 2009-12-14 18:16:47 -0500 |
---|---|---|
committer | Joey Hess <joey@gnu.kitenet.net> | 2009-12-14 18:16:47 -0500 |
commit | 2bceb10b5fd06e8e0867cbc6d72a16cbaae35803 (patch) | |
tree | e0ce6d985864e7f1db28c0b795c13b417bd54b9c | |
parent | 40078b1781c47228358fd193733d82f0429566eb (diff) | |
download | ikiwiki-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.
-rw-r--r-- | IkiWiki/CGI.pm | 12 | ||||
-rw-r--r-- | IkiWiki/Plugin/getsource.pm | 3 | ||||
-rw-r--r-- | IkiWiki/Plugin/goto.pm | 3 | ||||
-rw-r--r-- | debian/changelog | 1 |
4 files changed, 13 insertions, 6 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.")); } } diff --git a/IkiWiki/Plugin/getsource.pm b/IkiWiki/Plugin/getsource.pm index ae9ea3cc7..d1555430e 100644 --- a/IkiWiki/Plugin/getsource.pm +++ b/IkiWiki/Plugin/getsource.pm @@ -58,7 +58,8 @@ sub cgi_getsource ($) { if (! exists $pagesources{$page}) { IkiWiki::cgi_custom_failure( - $cgi->header(-status => "404 Not Found"), + $cgi, + "404 Not Found", IkiWiki::misctemplate(gettext("missing page"), "<p>". sprintf(gettext("The page %s does not exist."), diff --git a/IkiWiki/Plugin/goto.pm b/IkiWiki/Plugin/goto.pm index 2e2dc04a1..439552f62 100644 --- a/IkiWiki/Plugin/goto.pm +++ b/IkiWiki/Plugin/goto.pm @@ -51,7 +51,8 @@ sub cgi_goto ($;$) { if (! length $link) { IkiWiki::cgi_custom_failure( - $q->header(-status => "404 Not Found"), + $q, + "404 Not Found", IkiWiki::misctemplate(gettext("missing page"), "<p>". sprintf(gettext("The page %s does not exist."), diff --git a/debian/changelog b/debian/changelog index d84477298..ff922532a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,7 @@ ikiwiki (3.20091203) UNRELEASED; urgency=low * attachment: Fix several utf-8 problems. * attachment: Fix reversion in attachment sorting by age. * remove: Fix problem removing pages with utf-8 in the name. + * 404/goto: Fix 404 display of utf-8 pages. -- Joey Hess <joeyh@debian.org> Wed, 02 Dec 2009 17:22:21 -0500 |