Skip to content

Commit 4451568

Browse files
Merge branch '5.3' into 5.4
* 5.3: [HttpClient] Remove deprecated usage of `GuzzleHttp\Promise\queue` [PropertyAccess] Fix handling of uninitialized property of anonymous class [FrameworkBundle] Allow default cache pools to be overwritten by user [DependencyInjection] fix test ResolveBindingsPass remove loading of class iterable [FrameworkBundle] Avoid calling rtrim(null, '/') in AssetsInstallCommand [DependencyInjection] Fix nested env var with resolve processor Allow OutputFormatter::escape() to be used for escaping URLs used in <href> allow a zero time-limit [DependencyInjection] Ignore argument type check in CheckTypeDeclarationsPass if it's a Definition with a factory [Validators] Add translations for Slovak #43735
2 parents 26a3f24 + d1f7dac commit 4451568

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

Command/AssetsInstallCommand.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
9696
{
9797
/** @var KernelInterface $kernel */
9898
$kernel = $this->getApplication()->getKernel();
99-
$targetArg = rtrim($input->getArgument('target'), '/');
100-
99+
$targetArg = rtrim($input->getArgument('target') ?? '', '/');
101100
if (!$targetArg) {
102101
$targetArg = $this->getPublicDirectory($kernel->getContainer());
103102
}

DependencyInjection/FrameworkExtension.php

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -341,34 +341,10 @@ public function load(array $configs, ContainerBuilder $container)
341341
}
342342
}
343343

344-
// register cache before session so both can share the connection services
345-
$this->registerCacheConfiguration($config['cache'], $container);
346-
347-
if ($this->isConfigEnabled($container, $config['session'])) {
348-
if (!\extension_loaded('session')) {
349-
throw new LogicException('Session support cannot be enabled as the session extension is not installed. See https://php.net/session.installation for instructions.');
350-
}
351-
352-
$this->sessionConfigEnabled = true;
353-
$this->registerSessionConfiguration($config['session'], $container, $loader);
354-
if (!empty($config['test'])) {
355-
// test listener will replace the existing session listener
356-
// as we are aliasing to avoid duplicated registered events
357-
$container->setAlias('session_listener', 'test.session.listener');
358-
}
359-
} elseif (!empty($config['test'])) {
360-
$container->removeDefinition('test.session.listener');
361-
}
362-
363344
if ($this->isConfigEnabled($container, $config['request'])) {
364345
$this->registerRequestConfiguration($config['request'], $container, $loader);
365346
}
366347

367-
if (null === $config['csrf_protection']['enabled']) {
368-
$config['csrf_protection']['enabled'] = $this->sessionConfigEnabled && !class_exists(FullStack::class) && ContainerBuilder::willBeAvailable('symfony/security-csrf', CsrfTokenManagerInterface::class, ['symfony/framework-bundle'], true);
369-
}
370-
$this->registerSecurityCsrfConfiguration($config['csrf_protection'], $container, $loader);
371-
372348
if ($this->isConfigEnabled($container, $config['form'])) {
373349
if (!class_exists(Form::class)) {
374350
throw new LogicException('Form support cannot be enabled as the Form component is not installed. Try running "composer require symfony/form".');
@@ -501,6 +477,31 @@ public function load(array $configs, ContainerBuilder $container)
501477
$this->registerUidConfiguration($config['uid'], $container, $loader);
502478
}
503479

480+
// register cache before session so both can share the connection services
481+
$this->registerCacheConfiguration($config['cache'], $container);
482+
483+
if ($this->isConfigEnabled($container, $config['session'])) {
484+
if (!\extension_loaded('session')) {
485+
throw new LogicException('Session support cannot be enabled as the session extension is not installed. See https://php.net/session.installation for instructions.');
486+
}
487+
488+
$this->sessionConfigEnabled = true;
489+
$this->registerSessionConfiguration($config['session'], $container, $loader);
490+
if (!empty($config['test'])) {
491+
// test listener will replace the existing session listener
492+
// as we are aliasing to avoid duplicated registered events
493+
$container->setAlias('session_listener', 'test.session.listener');
494+
}
495+
} elseif (!empty($config['test'])) {
496+
$container->removeDefinition('test.session.listener');
497+
}
498+
499+
// csrf depends on session being registered
500+
if (null === $config['csrf_protection']['enabled']) {
501+
$config['csrf_protection']['enabled'] = $this->sessionConfigEnabled && !class_exists(FullStack::class) && ContainerBuilder::willBeAvailable('symfony/security-csrf', CsrfTokenManagerInterface::class, ['symfony/framework-bundle'], true);
502+
}
503+
$this->registerSecurityCsrfConfiguration($config['csrf_protection'], $container, $loader);
504+
504505
$this->addAnnotatedClassesToCompile([
505506
'**\\Controller\\',
506507
'**\\Entity\\',

0 commit comments

Comments
 (0)