From a2fe07433fec6c9f52f1ea36d7ef53bcd7c095a6 Mon Sep 17 00:00:00 2001 From: Benjamin Kellermann Date: Mon, 26 Oct 2009 15:56:00 +0100 Subject: fix encoding issue when creating poll with strange characters --- charset.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'charset.rb') diff --git a/charset.rb b/charset.rb index 07aedaf..5535844 100644 --- a/charset.rb +++ b/charset.rb @@ -4,10 +4,10 @@ # see License # ################################ -$utfcookie = CGI::Cookie.new("utf", "true") -$utfcookie.path = "/" +utfcookie = CGI::Cookie.new("utf", "true") +utfcookie.path = "/" if ($cgi.include?("utf") || $cgi.cookies["utf"][0]) && !$cgi.include?("ascii") - $utfcookie.expires = Time.now+1*60*60*24*365 + utfcookie.expires = Time.now+1*60*60*24*365 UTFASCII = "Change Charset to plain ASCII" YES = CGI.escapeHTML('✔') @@ -23,7 +23,7 @@ if ($cgi.include?("utf") || $cgi.cookies["utf"][0]) && !$cgi.include?("ascii") EDIT = CGI.escapeHTML("✍") DELETE = CGI.escapeHTML("⌧") else - $utfcookie.expires = Time.now-1*60*60*24*36 + utfcookie.expires = Time.now-1*60*60*24*36 UTFASCII = "If you see all these characters: #{CGI.escapeHTML('✔✘?–↞←→↠✍⌧')} you can safely change the charset to UTF-8" YES = CGI.escapeHTML('OK') @@ -39,4 +39,4 @@ else EDIT = CGI.escapeHTML("edit") DELETE = CGI.escapeHTML("delete") end - +$header["cookie"] = utfcookie -- cgit v1.2.3