symfony/symfony — Issue #2884: [DependencyInjection] ParameterBag should turn %% to %
Author: ericclemmons
Created: 2011-12-15 03:32:32+00:00
State: open

Today, if you want a parameter like `{% some text %}` to be treated as a literal, you have to use `{%% some text %%}`.

The problem is **the escaped % stays doubled instead of being converted to a single %**. (This is the equivalent of leaving the slashes in `"a \"quoted\" string"`)

3bdb7c2b571c298f6ff4177667e8a59e7477eefe is where the test was changed so that it would pass.

* Escaped percentage signs (`%%`) should be replaced with (`%`) with the unit tests updated accordingly
* (*Recommended*) The regular expression **only** performs a variable lookup when there is no whitespace surrounding the parameter or within the parameter name (e.g. `%this.will.be.evaluated%`, `% this.wil.not.be %`, `%neither will this %`

I wanted to get your feedback before I submit the appropriate PR.

Thanks!