diff options
author | Benjamin Kellermann <Benjamin.Kellermann@gmx.de> | 2019-01-07 22:03:42 +0100 |
---|---|---|
committer | Benjamin Kellermann <Benjamin.Kellermann@gmx.de> | 2019-01-07 22:03:42 +0100 |
commit | 89afd0a64110710c135b558614cdd755a181349b (patch) | |
tree | fa7a3be955e2abea55cf77161189080258db90ee /error.cgi | |
parent | 4429d6269252a329fa579e19ff1a32ce694a5a4d (diff) |
code refactoring: better output encoding
Diffstat (limited to 'error.cgi')
-rwxr-xr-x | error.cgi | 7 |
1 files changed, 1 insertions, 6 deletions
@@ -27,11 +27,6 @@ else $d = Dudle.new(:title => _("Error"), :hide_lang_chooser => true, :load_extensions => false) end -def urlescape(str) - CGI.escapeHTML(CGI.escape(str).gsub("+","%20")) -end - - if File.exists?($conf.errorlog) begin a = File.open($conf.errorlog,"r").to_a @@ -50,7 +45,7 @@ end errormessagebody = _("Hi!\n\nI found a bug in your application at %{urlofsite}.\nI did the following:\n\n<please describe what you did>\n<e.g., I wanted to post a comment to the poll.>\n\nI am using <please state your browser and operating system>\n%{errormessage}\nSincerely,\n") % {:errormessage => errormessage, :urlofsite => $conf.siteurl} subject = _("Bug in Dudle") - $d << _("An error occurred while executing Dudle.<br/>Please send an error report, including your browser, operating system, and what you did to %{admin}.") % {:admin => "<a href='mailto:#{$conf.bugreportmail}?subject=#{urlescape(subject)}&body=#{urlescape(errormessagebody)}'>#{$conf.bugreportmail}</a>"} + $d << _("An error occurred while executing Dudle.<br/>Please send an error report, including your browser, operating system, and what you did to %{admin}.") % {:admin => "<a href='mailto:#{$conf.bugreportmail}?subject=#{CGI.escape(subject)}&body=#{CGI.escape(errormessagebody)}'>#{$conf.bugreportmail}</a>"} if (errorstr) errorheadstr = _("Please include the following as well:") |