mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 02:58:43 +02:00
N°8017 - Security - dependabot - Symfony's VarDumper vulnerable to un… (#731)
Upgrade all Symfony components to last security fix (~6.4.0)
This commit is contained in:
@@ -117,7 +117,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
||||
private array $vendors;
|
||||
|
||||
/**
|
||||
* @var string[] the list of paths in vendor directories
|
||||
* @var array<string, bool> the cache for paths being in vendor directories
|
||||
*/
|
||||
private array $pathsInVendor = [];
|
||||
|
||||
@@ -155,7 +155,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
||||
'mixed' => true,
|
||||
];
|
||||
|
||||
public function __construct(ParameterBagInterface $parameterBag = null)
|
||||
public function __construct(?ParameterBagInterface $parameterBag = null)
|
||||
{
|
||||
parent::__construct($parameterBag);
|
||||
|
||||
@@ -360,7 +360,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
||||
$resource = new ClassExistenceResource($class, false);
|
||||
$classReflector = $resource->isFresh(0) ? false : new \ReflectionClass($class);
|
||||
} else {
|
||||
$classReflector = class_exists($class) ? new \ReflectionClass($class) : false;
|
||||
$classReflector = class_exists($class) || interface_exists($class, false) ? new \ReflectionClass($class) : false;
|
||||
}
|
||||
} catch (\ReflectionException $e) {
|
||||
if ($throw) {
|
||||
@@ -431,7 +431,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
||||
* @throws BadMethodCallException When this ContainerBuilder is compiled
|
||||
* @throws \LogicException if the extension is not registered
|
||||
*/
|
||||
public function loadFromExtension(string $extension, array $values = null): static
|
||||
public function loadFromExtension(string $extension, ?array $values = null): static
|
||||
{
|
||||
if ($this->isCompiled()) {
|
||||
throw new BadMethodCallException('Cannot load from an extension on a compiled container.');
|
||||
@@ -531,7 +531,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
||||
return $this->doGet($id, $invalidBehavior);
|
||||
}
|
||||
|
||||
private function doGet(string $id, int $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, array &$inlineServices = null, bool $isConstructorArgument = false): mixed
|
||||
private function doGet(string $id, int $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, ?array &$inlineServices = null, bool $isConstructorArgument = false): mixed
|
||||
{
|
||||
if (isset($inlineServices[$id])) {
|
||||
return $inlineServices[$id];
|
||||
@@ -742,10 +742,11 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
||||
* * The parameter bag is frozen;
|
||||
* * Extension loading is disabled.
|
||||
*
|
||||
* @param bool $resolveEnvPlaceholders Whether %env()% parameters should be resolved using the current
|
||||
* env vars or be replaced by uniquely identifiable placeholders.
|
||||
* Set to "true" when you want to use the current ContainerBuilder
|
||||
* directly, keep to "false" when the container is dumped instead.
|
||||
* @param bool $resolveEnvPlaceholders Whether %env()% parameters should be resolved at build time using
|
||||
* the current env var values (true), or be resolved at runtime based
|
||||
* on the environment (false). In general, this should be set to "true"
|
||||
* when you want to use the current ContainerBuilder directly, and to
|
||||
* "false" when the container is dumped instead.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
@@ -900,7 +901,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
||||
* This methods allows for simple registration of service definition
|
||||
* with a fluid interface.
|
||||
*/
|
||||
public function register(string $id, string $class = null): Definition
|
||||
public function register(string $id, ?string $class = null): Definition
|
||||
{
|
||||
return $this->setDefinition($id, new Definition($class));
|
||||
}
|
||||
@@ -911,7 +912,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
||||
* This method implements a shortcut for using setDefinition() with
|
||||
* an autowired definition.
|
||||
*/
|
||||
public function autowire(string $id, string $class = null): Definition
|
||||
public function autowire(string $id, ?string $class = null): Definition
|
||||
{
|
||||
return $this->setDefinition($id, (new Definition($class))->setAutowired(true));
|
||||
}
|
||||
@@ -1029,7 +1030,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
||||
* @throws RuntimeException When the service is a synthetic service
|
||||
* @throws InvalidArgumentException When configure callable is not callable
|
||||
*/
|
||||
private function createService(Definition $definition, array &$inlineServices, bool $isConstructorArgument = false, string $id = null, bool|object $tryProxy = true): mixed
|
||||
private function createService(Definition $definition, array &$inlineServices, bool $isConstructorArgument = false, ?string $id = null, bool|object $tryProxy = true): mixed
|
||||
{
|
||||
if (null === $id && isset($inlineServices[$h = spl_object_hash($definition)])) {
|
||||
return $inlineServices[$h];
|
||||
@@ -1059,14 +1060,15 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
||||
}
|
||||
|
||||
if (\is_array($callable) && (
|
||||
$callable[0] instanceof Reference
|
||||
'Closure' !== $class
|
||||
|| $callable[0] instanceof Reference
|
||||
|| $callable[0] instanceof Definition && !isset($inlineServices[spl_object_hash($callable[0])])
|
||||
)) {
|
||||
$initializer = function () use ($callable, &$inlineServices) {
|
||||
return $this->doResolveServices($callable[0], $inlineServices);
|
||||
};
|
||||
|
||||
$proxy = eval('return '.LazyClosure::getCode('$initializer', $callable, $definition, $this, $id).';');
|
||||
$proxy = eval('return '.LazyClosure::getCode('$initializer', $callable, $class, $this, $id).';');
|
||||
$this->shareService($definition, $proxy, $id, $inlineServices);
|
||||
|
||||
return $proxy;
|
||||
@@ -1380,7 +1382,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
||||
* "$fooBar"-named arguments with $type as type-hint. Such arguments will
|
||||
* receive the service $id when autowiring is used.
|
||||
*/
|
||||
public function registerAliasForArgument(string $id, string $type, string $name = null): Alias
|
||||
public function registerAliasForArgument(string $id, string $type, ?string $name = null): Alias
|
||||
{
|
||||
$parsedName = (new Target($name ??= $id))->getParsedName();
|
||||
|
||||
@@ -1427,7 +1429,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
||||
*
|
||||
* @return mixed The value with env parameters resolved if a string or an array is passed
|
||||
*/
|
||||
public function resolveEnvPlaceholders(mixed $value, string|bool $format = null, array &$usedEnvs = null): mixed
|
||||
public function resolveEnvPlaceholders(mixed $value, string|bool|null $format = null, ?array &$usedEnvs = null): mixed
|
||||
{
|
||||
$bag = $this->getParameterBag();
|
||||
if (true === $format ??= '%%env(%s)%%') {
|
||||
|
||||
Reference in New Issue
Block a user