Skip to content

Commit 9d9aa66

Browse files
authored
Merge pull request #677 from bugsnag/next
Release v3.29.3
2 parents 437ac55 + fcb1ece commit 9d9aa66

File tree

4 files changed

+25
-2
lines changed

4 files changed

+25
-2
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
Changelog
22
=========
33

4+
## 3.29.3 (2025-03-06)
5+
6+
### Fixes
7+
8+
* Redact user metadata according to redacted keys configuration
9+
[#675](https://github.com/bugsnag/bugsnag-php/pull/675)
10+
411
## 3.29.2 (2025-01-13)
512

613
This release should ensure compatibility with PHP 8.4 by removing the usage of certain

src/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class Configuration implements FeatureDataStore
8585
*/
8686
protected $notifier = [
8787
'name' => 'Bugsnag PHP (Official)',
88-
'version' => '3.29.2',
88+
'version' => '3.29.3',
8989
'url' => 'https://bugsnag.com',
9090
];
9191

src/Report.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ public function toArray()
764764
$event = [
765765
'app' => $this->config->getAppData(),
766766
'device' => array_merge(['time' => $this->time], $this->config->getDeviceData()),
767-
'user' => $this->getUser(),
767+
'user' => $this->cleanupObj($this->getUser(), true),
768768
'context' => $this->getContext(),
769769
'payloadVersion' => HttpClient::NOTIFY_PAYLOAD_VERSION,
770770
'severity' => $this->getSeverity(),

tests/ReportTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,22 @@ public function testUser()
117117
$this->assertSame(['foo' => 'bar'], $this->report->toArray()['user']);
118118
}
119119

120+
public function testUserDefaultFilters()
121+
{
122+
$this->report->setUser(['foo' => 'bar', 'password' => 'mypass', 'custom_field' => 'some data']);
123+
124+
$this->assertSame(['foo' => 'bar', 'password' => '[FILTERED]', 'custom_field' => 'some data'], $this->report->toArray()['user']);
125+
}
126+
127+
public function testUserCustomFilters()
128+
{
129+
$this->config->setFilters(['custom_field']);
130+
131+
$this->report->setUser(['foo' => 'bar', 'password' => 'mypass', 'custom_field' => 'some data']);
132+
133+
$this->assertSame(['foo' => 'bar', 'password' => 'mypass', 'custom_field' => '[FILTERED]'], $this->report->toArray()['user']);
134+
}
135+
120136
public function testDefaultFilters()
121137
{
122138
$metadata = array_reduce(

0 commit comments

Comments
 (0)