diff options
author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-12-24 14:42:38 +0000 |
---|---|---|
committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-12-24 14:42:38 +0000 |
commit | 36dbbb1b6a4a254feadf8cbbd30a02bda5c2b2d8 (patch) | |
tree | d653a0138e5869bddfeb3ee906b2b83cb03fad60 | |
parent | 96737482af95074829afd897a987bee4f72337d5 (diff) | |
download | ruby-36dbbb1b6a4a254feadf8cbbd30a02bda5c2b2d8.tar.gz |
* lib/cgi.rb (Cookie::parse), lib/cgi-lib.rb (initialize): Do not
pass to split() a bare string longer than 2 characters as
separator.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | lib/cgi-lib.rb | 2 | ||||
-rw-r--r-- | lib/cgi.rb | 2 |
3 files changed, 8 insertions, 2 deletions
@@ -1,3 +1,9 @@ +Tue Dec 24 23:37:40 2002 TADA Tadashi <sho@spc.gr.jp> + + * lib/cgi.rb (Cookie::parse), lib/cgi-lib.rb (initialize): Do not + pass to split() a bare string longer than 2 characters as + separator. + Tue Dec 24 19:19:24 2002 Tietew <tietew@tietew.net> * numeric.c (DBL_MAX_10_EXP): fix typo. [ruby-dev:36826] diff --git a/lib/cgi-lib.rb b/lib/cgi-lib.rb index ab4eef1068..bc780ffc4e 100644 --- a/lib/cgi-lib.rb +++ b/lib/cgi-lib.rb @@ -181,7 +181,7 @@ class CGI < SimpleDelegator super(@inputs) if ENV.has_key?('HTTP_COOKIE') or ENV.has_key?('COOKIE') - (ENV['HTTP_COOKIE'] or ENV['COOKIE']).split("; ").each do |x| + (ENV['HTTP_COOKIE'] or ENV['COOKIE']).split(/; /).each do |x| key, val = x.split(/=/,2) key = CGI::unescape(key) val = val.split(/&/).collect{|x|CGI::unescape(x)}.join("\0") diff --git a/lib/cgi.rb b/lib/cgi.rb index 714a3a2099..3dc5d51901 100644 --- a/lib/cgi.rb +++ b/lib/cgi.rb @@ -698,7 +698,7 @@ convert string charset, and set language to "ja". cookies = Hash.new([]) return cookies unless raw_cookie - raw_cookie.split('; ').each do |pairs| + raw_cookie.split(/; /).each do |pairs| name, values = pairs.split('=',2) name = CGI::unescape(name) values ||= "" |