-
-
Notifications
You must be signed in to change notification settings - Fork 452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding breadcrumbs to sanitize / serialize. #538
Conversation
Thanks for the contribution! Have you tried this on a live setup? |
Yes, it has been tested in live setup. Using this fork in production now. I had some questions when adding this code:
I didn't see the 2.x version! Will check on that and test this bug against the new branch. |
The 2.x branch is still in development, but we should be near to something usable as an alpha, probably! As per the data limitation, the reason is that the Sentry server has some hard limits on that, see docs. Breadcrumbs shouldn't have those. As for the test, yep, that case is good ti imitate. |
test/Raven/Tests/ClientTest.php
Outdated
'data' => array( | ||
'line' => 1216, | ||
'bindings' => array( | ||
array('foo', 'bar'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be ideal if these tests also tested to see if mb_convert_encoding($value, 'UTF-8');
is working properly. I'm not sure how to include binary data in the test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this could help? https://blog-en.openalfa.com/how-to-work-with-binary-data-in-php
Also, temporarely commenting your fix should make the test fail...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CI tests fail if there are PR comments? Thats kinda cool. I am going to add the binary check in the test and then rebase / squish and remove these comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, I meant that if you locally comment the piece of code that you applied as a fix, your test has to fail; it's just a practical test to see if your test is properly written and does his job correctly.
Unrelated, but would love to see styleCI added as a CI here to enforce PSR formatting and coding standards. It looks like 2.x dropped the old |
I think travis is failing because the encoding might be different for some php versions? My tests locally pass and the new code creates a passing test. Not sure how to proceed. The serializer property on client is protected making it hard to use the build in encoding detection. |
As for CS, 2.x is under PHPCSFixer and it's checked in the Travis build, so we're covered. For the build failures, it seems that there are some differences for PHP <5.6. Maybe you should try to use some different bytes? |
I found a different binary data that seems to work! Pretty random but does work. Squishing commits now. |
(cherry picked from commit 0904031)
Breadcrumbs are not being sanitized. When the inputs contain binary data (binary UUID for instance) the json_encode fails and no report is sent.