`scrubFields` config doesn't support paths (e.g. request.session.myKey)?
@danielmorell is already working on this.
Since Dec 20, 2022.
- Dominant language
- PHP
- Stars
- 337
- Forks
- 116
- Avg merge
- 17d 2h
- Merged PRs (30d)
- 1
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.