diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2006-09-12 20:57:09 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2006-09-12 20:57:09 +0000 |
commit | 7661c2b50aa5ab6d497d6e41cf53545136c4bd37 (patch) | |
tree | 55d65c748aa174b74933b61b375bef83845140e0 /actionpack/lib | |
parent | 74f60c032e92b2473b5feeeb85782836c2b83fdd (diff) | |
download | rails-7661c2b50aa5ab6d497d6e41cf53545136c4bd37.tar.gz rails-7661c2b50aa5ab6d497d6e41cf53545136c4bd37.tar.bz2 rails-7661c2b50aa5ab6d497d6e41cf53545136c4bd37.zip |
Skip params with empty names, such as the &=Save query string from <input type=submit/>. Closes #2569.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5094 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-rwxr-xr-x | actionpack/lib/action_controller/cgi_ext/cgi_methods.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/cgi_ext/cgi_methods.rb b/actionpack/lib/action_controller/cgi_ext/cgi_methods.rb index 3c2a1abbb6..de412a4683 100755 --- a/actionpack/lib/action_controller/cgi_ext/cgi_methods.rb +++ b/actionpack/lib/action_controller/cgi_ext/cgi_methods.rb @@ -11,6 +11,7 @@ class CGIMethods #:nodoc: pairs = query_string.split('&').collect do |chunk| next if chunk.empty? key, value = chunk.split('=', 2) + next if key.empty? value = (value.nil? || value.empty?) ? nil : CGI.unescape(value) [ key, value ] end.compact @@ -26,7 +27,7 @@ class CGIMethods #:nodoc: until finished finished = true for key, value in params - next unless key + next if key.blank? if !key.include?('[') # much faster to test for the most common case first (GET) # and avoid the call to build_deep_hash |