File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,9 @@ public function process(array $event): array
2727 }
2828
2929 // Security hide clear text password
30- unset($ event ['extra ' ]['password ' ]);
30+ if (isset ($ event ['extra ' ])) {
31+ $ event ['extra ' ] = $ this ->redactSensitiveData ($ event ['extra ' ]);
32+ }
3133
3234 return $ event ;
3335 }
Original file line number Diff line number Diff line change @@ -59,10 +59,15 @@ public function testProcess(): void
5959 'message ' => '' ,
6060 'extra ' => [
6161 'errno ' => 1 ,
62+ 'password ' => 'sensitive ' ,
6263 ],
6364 ]);
6465
6566 self ::assertStringContainsString ('Stacktrace: ' , $ actual ['message ' ]);
67+ self ::assertSame ([
68+ 'errno ' => 1 ,
69+ 'password ' => '***REDACTED*** ' ,
70+ ], $ actual ['extra ' ]);
6671 self ::assertSame (123 , $ actual ['creator_id ' ]);
6772 self ::assertSame ('my login ' , $ actual ['login ' ]);
6873 self ::assertIsString ($ actual ['url ' ]);
You can’t perform that action at this time.
0 commit comments