X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/81a9b5feffa241cea901c3633323bb446d61edf3..73f4a8835876c8cb07808367cd72d9ae972893e8:/IkiWiki/CGI.pm?ds=sidebyside diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index 52cafade0..866711a71 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -40,7 +40,8 @@ sub showform ($$$$;@) { sub redirect ($$) { my $q=shift; - my $url=shift; + eval q{use URI}; + my $url=URI->new(shift); if (! $config{w3mmode}) { print $q->redirect($url); } @@ -234,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 @@ -273,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.")); } }