Skip to content

Commit

Permalink
ParameterBag no longer resolves parameters that have spaces.
Browse files Browse the repository at this point in the history
They must be strictly "%some.parameter%" or similar.
  • Loading branch information
ericclemmons committed Dec 27, 2011
1 parent 99011ca commit 85ca8e3
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -198,7 +198,7 @@ public function resolveString($value, array $resolving = array())
// 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])) {
Expand All @@ -212,7 +212,7 @@ public function resolveString($value, array $resolving = array())

$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));
Expand Down

0 comments on commit 85ca8e3

Please sign in to comment.