-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DoctrineBridge] Avoids blob values to be logged by doctrine #7297
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
Conversation
jfsimon
commented
Mar 7, 2013
Q | A |
---|---|
Bug fix? | yes |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | #7012 |
// Blob data must not be logged as they can be very huge and break formatters. | ||
foreach ($types as $index => $type) { | ||
if ('blob' === $type) { | ||
$params[$index] = ''; |
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 instead of empty content, some thing like: blob value
(similar for "deep array" skipping when var_dump'ing).
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.
@stloyd good idea!
what about clob ? |
@pborreli do you think clob values shouldn't be logged? |
well they can have same size than blob |
I agree, skipping clobs as well would be WIN :-) |
if (is_array($types)) { | ||
// Blob data must not be logged as they can be very huge and break formatters. | ||
foreach ($types as $index => $type) { | ||
if ('blob' === $type) { |
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.
i am not sure this works, $type is an Instance of Type here in my opinion. you should cast it to (string) to be sure.
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.
👍
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.
I var_dump
ed $type
and got an array of strings.
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.
@jfsimon DBAL allows passing either the type name or the type itself.
Where are the tests? |
Ah yes, the DbalLogger has a testsuite, can you extend it to show this behavior works? |
@francisbesset @beberlei tests written. |
May I also ask for text/char fields with a certain amount of chars? |
} | ||
|
||
// non utf-8 strings break json encoding | ||
if ('UTF-8' !== mb_detect_encoding($params[$index], 'UTF-8', true)) { |
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.
mb_string
is not required for Symfony.
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.
fixed
} | ||
|
||
// non utf-8 strings break json encoding | ||
if (null === preg_match('#[^\p{L}\p{N} ]#u', $params[$index])) { |
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.
is this spacea inside []
intended?
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.
I dont know, I reused the pattern found here: https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Templating/PhpEngine.php#L505
This PR was squashed before being merged into the 2.1 branch (closes #7297). Commits ------- ef53456 [DoctrineBridge] Avoids blob values to be logged by doctrine Discussion ---------- [DoctrineBridge] Avoids blob values to be logged by doctrine | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #7012 --------------------------------------------------------------------------- by pborreli at 2013-03-07T17:07:23Z what about clob ? --------------------------------------------------------------------------- by jfsimon at 2013-03-07T17:10:45Z @pborreli do you think clob values shouldn't be logged? --------------------------------------------------------------------------- by pborreli at 2013-03-07T17:26:27Z well they can have same size than blob --------------------------------------------------------------------------- by beberlei at 2013-03-07T18:07:15Z I agree, skipping clobs as well would be WIN :-) --------------------------------------------------------------------------- by francisbesset at 2013-03-08T08:44:08Z Where are the tests? --------------------------------------------------------------------------- by beberlei at 2013-03-08T09:25:20Z Ah yes, the DbalLogger has a testsuite, can you extend it to show this behavior works? --------------------------------------------------------------------------- by jfsimon at 2013-03-08T10:28:53Z @francisbesset @beberlei tests written. --------------------------------------------------------------------------- by staabm at 2013-03-10T16:00:55Z May I also ask for text/char fields with a certain amount of chars?
This PR was squashed before being merged into the 2.1 branch (closes #7392). Commits ------- 67fbbac [DoctrineBridge] Fixed non-utf-8 recognition Discussion ---------- [DoctrineBridge] Fixed non-utf-8 recognition | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #7297 --------------------------------------------------------------------------- by jfsimon at 2013-03-15T15:10:28Z :+1: --------------------------------------------------------------------------- by francisbesset at 2013-03-15T15:17:17Z :-1: --------------------------------------------------------------------------- by pborreli at 2013-03-15T15:21:10Z travis test is failing https://travis-ci.org/symfony/symfony/jobs/5529163#L225 --------------------------------------------------------------------------- by pborreli at 2013-03-15T15:35:31Z if there is any regression it could help to write a new failing test first. --------------------------------------------------------------------------- by jfsimon at 2013-03-15T15:55:52Z @pborreli the test was already failing --------------------------------------------------------------------------- by pborreli at 2013-03-15T15:58:52Z @jfsimon ah ok, well it still fails 😃 --------------------------------------------------------------------------- by francisbesset at 2013-03-15T16:00:39Z @jfsimon if this is true I gives: 👍 --------------------------------------------------------------------------- by jfsimon at 2013-03-15T16:14:47Z @saro0h \o/ --------------------------------------------------------------------------- by pborreli at 2013-03-15T16:16:54Z :+1: