Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed the unescaping of parameters to handle arrays

  • Loading branch information...
commit 8e13095e5c584e3f693c3789148440411df816a0 1 parent 045f936
@stof stof authored
View
20 src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php
@@ -139,7 +139,7 @@ public function resolve()
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 @@ public function isResolved()
{
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;
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.