diff --git a/lib/Raven/Client.php b/lib/Raven/Client.php index 346cfdc6c..85492a57e 100644 --- a/lib/Raven/Client.php +++ b/lib/Raven/Client.php @@ -925,6 +925,9 @@ public function sanitize(&$data) if (!empty($data['contexts'])) { $data['contexts'] = $this->serializer->serialize($data['contexts'], 5); } + if (!empty($data['breadcrumbs'])) { + $data['breadcrumbs'] = $this->serializer->serialize($data['breadcrumbs'], 5); + } } /** diff --git a/test/Raven/Tests/ClientTest.php b/test/Raven/Tests/ClientTest.php index 112dee5c3..82eb49d28 100644 --- a/test/Raven/Tests/ClientTest.php +++ b/test/Raven/Tests/ClientTest.php @@ -1281,6 +1281,36 @@ public function testSanitizeContexts() )), $data); } + /** + * @covers Raven_Client::sanitize + */ + public function testSanitizeBreadcrumbs() + { + $client = new Dummy_Raven_Client(); + $data = array('breadcrumbs' => array(array( + 'message' => 'foo', + 'utf8' => pack("NA3CC", 3, "aBc", 0x0D, 0x0A), + 'data' => array( + 'line' => 1216, + 'bindings' => array( + array('foo', pack("NA3CC", 3, "aBc", 0x0D, 0x0A)), + ) + ), + ))); + $client->sanitize($data); + + $this->assertEquals(array('breadcrumbs' => array(array( + 'message' => 'foo', + 'utf8' => mb_convert_encoding(pack("NA3CC", 3, "aBc", 0x0D, 0x0A), 'UTF-8'), + 'data' => array( + 'line' => 1216, + 'bindings' => array( + array('foo', mb_convert_encoding(pack("NA3CC", 3, "aBc", 0x0D, 0x0A), 'UTF-8')), + ) + ), + ))), $data); + } + /** * @covers Raven_Client::buildCurlCommand */