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
fatal error when using database password with two % #61
Comments
It should be single quoted. So
can you check that, pls? :) |
Hmm, this article only says
But in this case, the Using |
Every "%" has to be escaped with a second one no matter if it's at the beginning of not. See http://symfony.com/doc/current/service_container/parameters.html#parameters-in-configuration-files "If you use a string that starts with @ or has % anywhere in it, you need to escape it by adding another @ or %:" |
Fixed in 9bd4ea0. |
Same should be done for |
I wonder why the Sf parameter dumper does not do this by default? It also does not add any quotes. |
Are we supposed to check this ourselves? |
Where did you get that info from? |
There is an Escaper class, which however does not handle |
That should be done automatically when you use https://github.com/symfony/symfony/blob/c5cbc83a59eb218d720f31b0c5263e93dbf93a45/src/Symfony/Component/Yaml/Inline.php#L106 |
The escaping of |
Btw, the YAML way of escaping the |
Thanks @stof for shedding some light on this. |
Fixed in 263af55 now. |
Thanks @stof! Makes sense! I still think the fix is wrong, though :-) There's a |
@Toflar you could use this dumper to dump a ContainerBuilder in which you would have added the parameters. But I'm not sure it would work that well. Btw, inside a parameter, you don't need to double the initial |
Ah true, thanks for your comments - highly appreciated :) |
Removed in 7ce8feb. |
Reproduction
asd%asd%asd
for example.The following fatal error will occur:
Cause
The Install Tool creates the following
parameters.yml
:If any of your Symfony parameters contain two
%
, you need to escape them. This will work:According to https://stackoverflow.com/a/27274304/374996 using double quotes should also work, but I cannot confirm that. The error still occurs when using
"asd%asd%asd"
.The text was updated successfully, but these errors were encountered: