rollbar / rollbar/rollbar-php

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

Open
#479 1 comment 3 reactions 1 assignee View on GitHub

@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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.