Closed
Description
Q | A |
---|---|
Bug report? | yes |
Feature request? | no |
BC Break report? | no |
RFC? | no |
Symfony version | 3.3 |
I have this bug which is related (I think) to some modification you did in the ContainerBuilder.
Warning: stripos() expects parameter 1 to be string, array given
in /var/www/html/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php on line 1376
This is due to some environment variables I have which is an array. In the ContainerBuilder:
public function resolveEnvPlaceholders($value, $format = null, array &$usedEnvs = null)
{
if (null === $format) {
$format = '%%env(%s)%%';
}
if (is_array($value)) {
$result = array();
foreach ($value as $k => $v) {
$result[$this->resolveEnvPlaceholders($k, $format, $usedEnvs)] = $this->resolveEnvPlaceholders($v, $format, $usedEnvs);
}
return $result;
}
if (!is_string($value)) {
return $value;
}
$bag = $this->getParameterBag();
if (true === $format) {
$value = $bag->resolveValue($value);
}
I think you need to put this condition
if (true === $format) {
$value = $bag->resolveValue($value);
}
before this conditional:
if (is_array($value)) {
$result = array();
foreach ($value as $k => $v) {
$result[$this->resolveEnvPlaceholders($k, $format, $usedEnvs)] = $this->resolveEnvPlaceholders($v, $format, $usedEnvs);
}