diff options
Diffstat (limited to 'activesupport/lib/active_support/parameter_filter.rb')
-rw-r--r-- | activesupport/lib/active_support/parameter_filter.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/parameter_filter.rb b/activesupport/lib/active_support/parameter_filter.rb index 1389d82523..d58941c4e1 100644 --- a/activesupport/lib/active_support/parameter_filter.rb +++ b/activesupport/lib/active_support/parameter_filter.rb @@ -110,7 +110,14 @@ module ActiveSupport elsif value.is_a?(Hash) value = call(value, parents, original_params) elsif value.is_a?(Array) - value = value.map { |v| v.is_a?(Hash) ? call(v, parents, original_params) : v } + # If we don't pop of the current parent it will be duplicated as we + # process each array value. + parents.pop if deep_regexps + value = value.map do |v| + value_for_key(key, v, parents, original_params) + end + # Restore the parent stack after processing the array. + parents.push(key) if deep_regexps elsif blocks.any? key = key.dup if key.duplicable? value = value.dup if value.duplicable? |