From e3c0e4977449de2eec36e254a7e131693ba2f822 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 12 Jul 2008 23:23:25 -0400 Subject: only htmlize errors when cgi is actually running --- ikiwiki.in | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'ikiwiki.in') diff --git a/ikiwiki.in b/ikiwiki.in index e0a591824..cc3f210b5 100755 --- a/ikiwiki.in +++ b/ikiwiki.in @@ -100,7 +100,7 @@ sub getconfig () { #{{{ else { # wrapper passes a full config structure in the environment # variable - eval possibly_foolish_untaint($ENV{WRAPPED_OPTIONS}); + eval {possibly_foolish_untaint($ENV{WRAPPED_OPTIONS})}; if ($@) { error("WRAPPED_OPTIONS: $@"); } @@ -123,7 +123,10 @@ sub main () { #{{{ } elsif ($config{cgi}) { require IkiWiki::CGI; - cgi(); + eval {cgi()}; + if ($@) { + cgierror($@); + } } elsif ($config{render}) { require IkiWiki::Render; -- cgit v1.2.3