From f57e493bdd6c81ec4f26d0f2afb715c6581b7d74 Mon Sep 17 00:00:00 2001 From: Benjamin Kellermann Date: Thu, 28 Jan 2010 15:59:47 +0100 Subject: more robust --- error.cgi | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'error.cgi') diff --git a/error.cgi b/error.cgi index c74e80b..bd5cf1b 100755 --- a/error.cgi +++ b/error.cgi @@ -19,9 +19,18 @@ # along with dudle. If not, see . # ############################################################################ -require "dudle" - -$d = Dudle.new +require "cgi" +$cgi = CGI.new +require "config" +require "html" + +$h = HTML.new("Error") +$h.add_css("/default.css","default",true) +$h << < +
+

Error

+END def urlescape(str) CGI.escapeHTML(CGI.escape(str).gsub("+","%20")) @@ -46,7 +55,7 @@ if defined?(ERRORLOG) errorstr = "Exception while opening #{ERRORLOG}:\n#{e}" else s = [a.pop] - s << a.pop while s.last.scan(/^\[([^\]]*)\] \[/).flatten[0] == a.last.scan(/^\[([^\]]*)\] \[/).flatten[0] + s << a.pop while s.last.scan(/^\[([^\]]*)\] \[/).flatten[0] == a.last.scan(/^\[([^\]]*)\] \[/).flatten[0] || a.last =~ /^[^\[]/ errorstr = s.reverse.join end @@ -63,7 +72,7 @@ Yours, MESSAGE - $d << < Please report you browser, operating system, and what you did to #{BUGREPORTMAIL}. @@ -71,11 +80,12 @@ ERROR if (errorstr) - $d << < Please include the following as well:
#{errorstr}
ERROR end -$d.out +$h << "
" +$h.out($cgi) -- cgit v1.2.3