Skip to content

scrubFields config doesn't support paths (e.g. request.session.myKey)? #479

@drjayvee

Description

@drjayvee

Surely I must be doing something wrong, but it seems like scrubFields doesn't properly deal with paths (e.g. request.session.myKey).

I'm using v1.8.1 and have checked what happens in Scrubber::scrubArray:114. $fields is the scrubFields array from the configuration literal, which includes paths (e.g. request.session.myKey). $key, on the other hand, is always only the last part (e.g. myKey).

It looks like the code should check isset($fields[strtolower($current)]) as well as isset($fields[strtolower($key)]) maybe?

As an example:

Rollbar::init([
  'scrubFields' => [
    'request.session.myKey'
  ]
]);

Does not scrub myKey, while

Rollbar::init([
  'scrubFields' => [
    'myKey'
  ]
]);

does.

The documentation actually lists a couple of path values in the defaults (e.g. request.session.csrf_), so I fully expect this to work.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions