Fixed the unescaping of parameters to handle arrays
This commit is contained in:
parent
045f936038
commit
8e13095e5c
@ -139,7 +139,7 @@ class ParameterBag implements ParameterBagInterface
|
||||
foreach ($this->parameters as $key => $value) {
|
||||
try {
|
||||
$value = $this->resolveValue($value);
|
||||
$parameters[$key] = is_string($value) ? str_replace('%%', '%', $value) : $value;
|
||||
$parameters[$key] = $this->unescapeString($value);
|
||||
} catch (ParameterNotFoundException $e) {
|
||||
$e->setSourceKey($key);
|
||||
|
||||
@ -235,4 +235,22 @@ class ParameterBag implements ParameterBagInterface
|
||||
{
|
||||
return $this->resolved;
|
||||
}
|
||||
|
||||
private function unescapeString($value)
|
||||
{
|
||||
if (is_string($value)) {
|
||||
return str_replace('%%', '%', $value);
|
||||
}
|
||||
|
||||
if (is_array($value)) {
|
||||
$result = array();
|
||||
foreach ($value as $k => $v) {
|
||||
$result[$k] = $this->unescapeString($v);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user