Skip to content

Commit 7ef6a60

Browse files
author
Randy Geraads
committed
Cast all parameterBag values to string
1 parent 1382001 commit 7ef6a60

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Symfony/Component/HttpFoundation/ParameterBag.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ class ParameterBag implements \IteratorAggregate, \Countable
2727

2828
public function __construct(array $parameters = [])
2929
{
30+
self::castAllParametersToString($parameters);
31+
3032
$this->parameters = $parameters;
3133
}
3234

@@ -216,4 +218,11 @@ public function count()
216218
{
217219
return \count($this->parameters);
218220
}
221+
222+
private static function castAllParametersToString(array &$parameters)
223+
{
224+
array_walk_recursive($parameters, static function ($value, $key) use (&$parameters) {
225+
return $parameters[$key] = (string) $value;
226+
});
227+
}
219228
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy