diff options
author | xibbar <xibbar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-28 13:54:28 +0000 |
---|---|---|
committer | xibbar <xibbar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-28 13:54:28 +0000 |
commit | 5958f6af19e7b7dc6ac26e3ee310af02b562c77d (patch) | |
tree | d35e97a04d9ff1fb5645c56d09efcb7a28f507c5 /lib | |
parent | f2aabd1802b00ce7d23ab7733874b9a48f7495f0 (diff) | |
download | ruby-5958f6af19e7b7dc6ac26e3ee310af02b562c77d.tar.gz |
* 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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cgi/core.rb | 4 |
1 files changed, 3 insertions, 1 deletions
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 |