ParameterBag no longer resolves parameters that have spaces.

They must be strictly "%some.parameter%" or similar.
This commit is contained in:
Eric Clemmons 2011-12-27 12:49:22 -08:00
parent 99011ca9c9
commit 85ca8e3615

View File

@ -198,7 +198,7 @@ class ParameterBag implements ParameterBagInterface
// we do this to deal with non string values (Boolean, integer, ...)
// as the preg_replace_callback throw an exception when trying
// a non-string in a parameter value
if (preg_match('/^%([^%]+)%$/', $value, $match)) {
if (preg_match('/^%([^%\s]+)%$/', $value, $match)) {
$key = strtolower($match[1]);
if (isset($resolving[$key])) {
@ -212,7 +212,7 @@ class ParameterBag implements ParameterBagInterface
$self = $this;
return preg_replace_callback('/(?<!%)%([^%]+)%/', function ($match) use ($self, $resolving, $value) {
return preg_replace_callback('/(?<!%)%([^%\s]+)%/', function ($match) use ($self, $resolving, $value) {
$key = strtolower($match[1]);
if (isset($resolving[$key])) {
throw new ParameterCircularReferenceException(array_keys($resolving));