diff options
author | Leonel Galan <leonelgalan@gmail.com> | 2017-02-13 18:14:41 -0500 |
---|---|---|
committer | Leonel Galan <leonelgalan@gmail.com> | 2017-02-13 18:24:40 -0500 |
commit | 7306fe362b665b4aed1dd9de4035af9dad7137a6 (patch) | |
tree | e933fa1a20da31d62a13413167a399e7d83d177f /actionpack/lib | |
parent | 2809f38ab8d75dabb5b053ac14f5e78a2ad802fa (diff) | |
download | rails-7306fe362b665b4aed1dd9de4035af9dad7137a6.tar.gz rails-7306fe362b665b4aed1dd9de4035af9dad7137a6.tar.bz2 rails-7306fe362b665b4aed1dd9de4035af9dad7137a6.zip |
Use of ParameterFilter no longer forces `request.filtered_parameters' class to be Hash
- Fixes issue described on #27944
- `filtered_query_string` used an Array representation of what
semantically is a key value pair: better suited for a Hash. Without
this change `filtered_params = original_params.class.new` returns an
Array with unintended consequences.
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/http/filter_parameters.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/http/parameter_filter.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/http/filter_parameters.rb b/actionpack/lib/action_dispatch/http/filter_parameters.rb index e584b84d92..077ab2561f 100644 --- a/actionpack/lib/action_dispatch/http/filter_parameters.rb +++ b/actionpack/lib/action_dispatch/http/filter_parameters.rb @@ -74,7 +74,7 @@ module ActionDispatch PAIR_RE = %r{(#{KV_RE})=(#{KV_RE})} def filtered_query_string # :doc: query_string.gsub(PAIR_RE) do |_| - parameter_filter.filter([[$1, $2]]).first.join("=") + parameter_filter.filter($1 => $2).first.join("=") end end end diff --git a/actionpack/lib/action_dispatch/http/parameter_filter.rb b/actionpack/lib/action_dispatch/http/parameter_filter.rb index 889f55a52a..1d2b4b902b 100644 --- a/actionpack/lib/action_dispatch/http/parameter_filter.rb +++ b/actionpack/lib/action_dispatch/http/parameter_filter.rb @@ -54,7 +54,7 @@ module ActionDispatch end def call(original_params, parents = []) - filtered_params = {} + filtered_params = original_params.class.new original_params.each do |key, value| parents.push(key) if deep_regexps |