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

Skip to content

[DependencyInjection] Unescape parameters for all types of injection #16295

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

Merged
merged 1 commit into from
Nov 19, 2015

Conversation

Nicofuma
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR

The parameters must be escaped when injected in the container.
But they are only unescaped when the container is dumped and when these parameters are used in the service constructor.
We need to unescape them every time their are injected (constructor, setter and property injection)

@stof
Copy link
Member

stof commented Oct 20, 2015

I don't understand what you are trying to fix here

@Nicofuma
Copy link
Contributor Author

Migth be clearer with a simple example: https://gist.github.com/Nicofuma/a7672bf0776efb2eaa5f
the output is:

"%%unescape_it%%"
"%unescape_it%"

while we are expecting:

"%unescape_it%"
"%unescape_it%"

@Nicofuma
Copy link
Contributor Author

Nicofuma commented Nov 2, 2015

Bump, this is a real issue for us as it throws an error to some of our users - because they have a % in their database password - each time they clear the cache.

@Nicofuma Nicofuma closed this Nov 2, 2015
@Nicofuma Nicofuma reopened this Nov 2, 2015
@Oyabun1
Copy link

Oyabun1 commented Nov 2, 2015

this is a real issue for us as it throws an error to some of our users - because they have a % in their database password

I've had a few users of phpBB, experiencing the issue with the % character, try the changes in the commit and it resolved the problem for them.

@Nicofuma
Copy link
Contributor Author

Bump again

@stof could you give this PR another look please?

@Nicofuma
Copy link
Contributor Author

@stof @fabpot @Tobion anyone, could it be possible to have some feedbacks please?

@nicolas-grekas
Copy link
Member

👍
Status: reviewed

@fabpot
Copy link
Member

fabpot commented Nov 19, 2015

Thank you @Nicofuma.

@fabpot fabpot merged commit 331a046 into symfony:2.3 Nov 19, 2015
fabpot added a commit that referenced this pull request Nov 19, 2015
… injection (Nicofuma)

This PR was merged into the 2.3 branch.

Discussion
----------

[DependencyInjection] Unescape parameters for all types of injection

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

The parameters must be escaped when injected in the container.
But they are only unescaped when the container is dumped and when these parameters are used in the service constructor.
We need to unescape them every time their are injected (constructor, setter and property injection)

Commits
-------

331a046 [DependencyInjection] Unescape parameters for all types of injection
This was referenced Nov 23, 2015
This was referenced Nov 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants