1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
knu 2002-12-24 14:42:38 +00:00
parent 96737482af
commit 36dbbb1b6a
3 changed files with 8 additions and 2 deletions

View file

@ -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]

View file

@ -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")

View file

@ -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 ||= ""