Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: tchapi/davis
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4f303a46e3f412fa4e741a1703fdff90d1ce8053
Choose a base ref
..
head repository: tchapi/davis
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3d2ced04dc7a1492064269b658bd1c6357f3b9f8
Choose a head ref
Showing with 2 additions and 4 deletions.
  1. +2 −4 src/Logging/Monolog/PasswordFilterProcessor.php
6 changes: 2 additions & 4 deletions src/Logging/Monolog/PasswordFilterProcessor.php
Original file line number Diff line number Diff line change
@@ -13,13 +13,11 @@ final class PasswordFilterProcessor implements ProcessorInterface
public function __invoke(array $record): array
{
// Remove potentially sensitive data from function arguments
$shouldRedactArgs = array_key_exists("function", $record) && in_array($record['function'], self::SENSITIVE_ARGS_FUNCTIONS);
$shouldRedactArgs = array_key_exists('function', $record) && in_array($record['function'], self::SENSITIVE_ARGS_FUNCTIONS);

foreach ($record as $key => $item) {
if (self::PASSWORD_KEY === strtolower($key)) {
if (self::PASSWORD_KEY === strtolower($key) || ('args' === $key && $shouldRedactArgs)) {
$record[$key] = self::REDACTED;
} elseif($key === 'args' && $shouldRedactArgs) {
$record["args"] = [self::REDACTED];
} elseif (is_array($item)) {
$record[$key] = $this($item);
}