aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/cgi_ext
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_controller/cgi_ext')
-rwxr-xr-xactionpack/lib/action_controller/cgi_ext/cgi_methods.rb18
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
}