Skip to content

Commit 7229725

Browse files
committed
Make credit card parameter filtering more specific
Avoid unintentionally filtering out other parameters matching these names. In particular "number" is a param that shows up in other places is often important to *have* in the logs. These days most shops don't have credit card numbers posted directly to their applications anyway.
1 parent 36bb217 commit 7229725

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

core/lib/spree/core/engine.rb

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
module Spree
44
module Core
55
class Engine < ::Rails::Engine
6+
CREDIT_CARD_NUMBER_PARAM = /payment.*source.*\.number$/
7+
CREDIT_CARD_VERIFICATION_VALUE_PARAM = /payment.*source.*\.verification_value$/
8+
69
isolate_namespace Spree
710
engine_name 'spree'
811

@@ -30,8 +33,8 @@ class Engine < ::Rails::Engine
3033
app.config.filter_parameters += [
3134
%r{^password$},
3235
%r{^password_confirmation$},
33-
%r{^number$}, # Credit Card number
34-
%r{^verification_value$} # Credit Card verification value
36+
CREDIT_CARD_NUMBER_PARAM,
37+
CREDIT_CARD_VERIFICATION_VALUE_PARAM,
3538
]
3639
end
3740

0 commit comments

Comments
 (0)