Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[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

Closed
wants to merge 7 commits into from

Conversation

jfsimon
Copy link
Contributor

@jfsimon 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] = '';
Copy link
Contributor

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).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stloyd good idea!

@pborreli
Copy link
Contributor

pborreli commented Mar 7, 2013

what about clob ?

@jfsimon
Copy link
Contributor Author

jfsimon commented Mar 7, 2013

@pborreli do you think clob values shouldn't be logged?

@pborreli
Copy link
Contributor

pborreli commented Mar 7, 2013

well they can have same size than blob

@beberlei
Copy link
Contributor

beberlei commented Mar 7, 2013

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) {
Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I var_dumped $type and got an array of strings.

Copy link
Member

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.

@francisbesset
Copy link
Contributor

Where are the tests?

@beberlei
Copy link
Contributor

beberlei commented Mar 8, 2013

Ah yes, the DbalLogger has a testsuite, can you extend it to show this behavior works?

@jfsimon
Copy link
Contributor Author

jfsimon commented Mar 8, 2013

@francisbesset @beberlei tests written.

@staabm
Copy link
Contributor

staabm commented Mar 10, 2013

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)) {
Copy link
Member

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.

Copy link
Contributor Author

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])) {
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fabpot added a commit that referenced this pull request Mar 13, 2013
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?
@fabpot fabpot closed this Mar 13, 2013
fabpot added a commit that referenced this pull request Mar 16, 2013
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:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants