Skip to content

Commit

Permalink
* lib/cgi/core.rb (CGI::parse): ignore illegal query params.
Browse files Browse the repository at this point in the history
[ruby-dev:36618]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
xibbar committed Sep 28, 2008
1 parent f2aabd1 commit 5958f6a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Sun Sep 28 22:44:26 2008 Takeyuki Fujioka <xibbar@ruby-lang.org>

* lib/cgi/core.rb (CGI::parse): ignore illegal query params.
[ruby-dev:36618]

Sun Sep 28 22:05:07 2008 Yusuke Endoh <mame@tsg.ne.jp>

* compile.c (iseq_set_sequence): check duplicated when clause.
Expand Down
4 changes: 3 additions & 1 deletion lib/cgi/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,9 @@ def CGI::parse(query)
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
Expand Down

0 comments on commit 5958f6a

Please sign in to comment.