diff options
Diffstat (limited to 'actionpack/lib/action_controller/cgi_ext/cgi_methods.rb')
-rwxr-xr-x | actionpack/lib/action_controller/cgi_ext/cgi_methods.rb | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/actionpack/lib/action_controller/cgi_ext/cgi_methods.rb b/actionpack/lib/action_controller/cgi_ext/cgi_methods.rb index d922e48b10..3a14311acf 100755 --- a/actionpack/lib/action_controller/cgi_ext/cgi_methods.rb +++ b/actionpack/lib/action_controller/cgi_ext/cgi_methods.rb @@ -17,13 +17,17 @@ class CGIMethods #:nodoc: k = CGI.unescape(k) if k v = CGI.unescape(v) if v - keys = split_key(k) - last_key = keys.pop - last_key = keys.pop if (use_array = last_key.empty?) - parent = keys.inject(parsed_params) {|h, k| h[k] ||= {}} - - if use_array then (parent[last_key] ||= []) << v - else parent[last_key] = v + unless k.include?(?[) + parsed_params[k] = v + else + keys = split_key(k) + last_key = keys.pop + last_key = keys.pop if (use_array = last_key.empty?) + parent = keys.inject(parsed_params) {|h, k| h[k] ||= {}} + + if use_array then (parent[last_key] ||= []) << v + else parent[last_key] = v + end end } |