mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix filtered parameter logging with nil parameter values. Closes #8422.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6802 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
f6edfa3553
commit
8ba22a690c
3 changed files with 5 additions and 1 deletions
|
@ -1,5 +1,7 @@
|
|||
*SVN*
|
||||
|
||||
* Fix filtered parameter logging with nil parameter values. #8422 [choonkeat]
|
||||
|
||||
* Integration tests: alias xhr to xml_http_request and add a request_method argument instead of always using POST. #7124 [Nik Wakelin, Francois Beausoleil, Wizard]
|
||||
|
||||
* Document caches_action. #5419 [Jarkko Laine]
|
||||
|
|
|
@ -441,7 +441,8 @@ module ActionController #:nodoc:
|
|||
elsif value.is_a?(Hash)
|
||||
filtered_parameters[key] = filter_parameters(value)
|
||||
elsif block_given?
|
||||
key, value = key.dup, value.dup
|
||||
key = key.dup
|
||||
value = value.dup if value
|
||||
yield key, value
|
||||
filtered_parameters[key] = value
|
||||
else
|
||||
|
|
|
@ -16,6 +16,7 @@ class FilterParamTest < Test::Unit::TestCase
|
|||
assert @controller.respond_to?(:filter_parameters)
|
||||
|
||||
test_hashes = [[{},{},[]],
|
||||
[{'foo'=>nil},{'foo'=>nil},[]],
|
||||
[{'foo'=>'bar'},{'foo'=>'bar'},[]],
|
||||
[{'foo'=>'bar'},{'foo'=>'bar'},%w'food'],
|
||||
[{'foo'=>'bar'},{'foo'=>'[FILTERED]'},%w'foo'],
|
||||
|
|
Loading…
Reference in a new issue