This project is archived and is in readonly mode.
filter_parameter_logging fails with scalar values in an array
Reported by Cody Fauser | July 20th, 2009 @ 09:00 PM | in 2.3.4
filter_parameter_logging was enhanced to correctly filter within array params in http://github.com/rails/rails/commit/9407f6e9a428b37517fdd779eac15e....
This patch has a slight issue, which is that it fails when the values within the array are not hashes. This patch fixes the issue.
Comments and changes to this ticket
-
Michael Koziarski July 20th, 2009 @ 10:53 PM
- Milestone changed from 2.x to 2.3.4
- Assigned user set to Michael Koziarski
Targeting 2.3.4 for this
-
Sebastian Delmont July 20th, 2009 @ 10:59 PM
Slightly better patch that allows for nested arrays and hashes. It also includes tests that fail.
-
Sebastian Delmont July 20th, 2009 @ 11:08 PM
Technically, it fails when the values within the array are not enumerable.
The error didn't surface during testing because param values are always strings under normal conditions.
Only when testing controllers with params including arrays of integers (for example) you run into this issue.
A quick workaround is to convert to strings any non-string parameters in your tests.
-
Simone Carletti July 21st, 2009 @ 03:12 PM
The same here. This issue blocks me from upgrading to Rails 2.3.3.
With Rails 2.3.3 I have more than 10 failing tests.
I confirm that the bug has been introduced with http://github.com/rails/rails/commit/9407f6e9a428b37517fdd779eac15e.... Reverting the commit causes the tests to pass again. -
Simone Carletti July 21st, 2009 @ 11:29 PM
Hi Michael,
with the second path my tests passes again.I've got a couple of failure compared with Rails 2.3.2, but they don't seem to be related to this specific issue but with more probability to an incompatible GEM. That said, I'm confident to confirm Sebastian's patch successfully fixes the bugfix.
-
Repository July 22nd, 2009 @ 10:35 PM
- State changed from new to committed
(from [ead5d88bf178b8a32d151747a42df2aafa57eeaa]) Fix filter_parameter_logging of non-hash values within array params
Signed-off-by: Michael Koziarski michael@koziarski.com
[#2927 state:committed] http://github.com/rails/rails/commit/ead5d88bf178b8a32d151747a42df2...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Tags
Referenced by
- 2927 filter_parameter_logging fails with scalar values in an array Signed-off-by: Michael Koziarski michael@koziarski.com [#...