From 5958f6af19e7b7dc6ac26e3ee310af02b562c77d Mon Sep 17 00:00:00 2001 From: xibbar Date: Sun, 28 Sep 2008 13:54:28 +0000 Subject: [PATCH] * lib/cgi/core.rb (CGI::parse): ignore illegal query params. [ruby-dev:36618] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ lib/cgi/core.rb | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7d3bea9186..8c44fe9e0d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun Sep 28 22:44:26 2008 Takeyuki Fujioka + + * lib/cgi/core.rb (CGI::parse): ignore illegal query params. + [ruby-dev:36618] + Sun Sep 28 22:05:07 2008 Yusuke Endoh * compile.c (iseq_set_sequence): check duplicated when clause. diff --git a/lib/cgi/core.rb b/lib/cgi/core.rb index b99f5a1c7d..765a026c2b 100644 --- a/lib/cgi/core.rb +++ b/lib/cgi/core.rb @@ -337,7 +337,9 @@ class CGI params = {} query.split(/[&;]/).each do |pairs| key, value = pairs.split('=',2).collect{|v| CGI::unescape(v) } - params.has_key?(key) ? params[key].push(value) : params[key] = [value] + if key && value + params.has_key?(key) ? params[key].push(value) : params[key] = [value] + end end params.default=[].freeze params