X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/3879c56e71bb2e0d5fda81982d900fc93d4a893d..df42a5ef21fd3e97ab287fa48ccd3aafd34e0375:/IkiWiki/CGI.pm?ds=inline diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index 2a847eb17..d805506aa 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -1,5 +1,7 @@ #!/usr/bin/perl +package IkiWiki; + use warnings; use strict; use IkiWiki; @@ -7,8 +9,6 @@ use IkiWiki::UserInfo; use open qw{:utf8 :std}; use Encode; -package IkiWiki; - sub printheader ($) { #{{{ my $session=shift; @@ -750,4 +750,14 @@ sub cgi (;$$) { #{{{ } } #}}} +# Does not need tobe called directly; all errors will go through here. +sub cgierror ($) { #{{{ + my $message=shift; + + print "Content-type: text/html\n\n"; + print misctemplate(gettext("Error"), + "

".gettext("Error").": $message

"); + die $@; +} #}}} + 1