diff options
-rw-r--r-- | actionpack/CHANGELOG | 2 | ||||
-rwxr-xr-x | actionpack/lib/action_controller/base.rb | 3 | ||||
-rw-r--r-- | actionpack/test/controller/filter_params_test.rb | 1 |
3 files changed, 5 insertions, 1 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG index 2094e9edd9..ee2e64f82c 100644 --- a/actionpack/CHANGELOG +++ b/actionpack/CHANGELOG @@ -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] diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index 6ba5e141ea..cfd60ac6bf 100755 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -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 diff --git a/actionpack/test/controller/filter_params_test.rb b/actionpack/test/controller/filter_params_test.rb index 5ad0d7f81d..7b810b1624 100644 --- a/actionpack/test/controller/filter_params_test.rb +++ b/actionpack/test/controller/filter_params_test.rb @@ -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'], |