Skip to content

Commit 7fcdbce

Browse files
Merge branch '4.4' into 5.0
* 4.4: (30 commits) [Security] Check UserInterface::getPassword is not null before calling needsRehash gracefully handle missing event dispatchers Fix TokenStorage::reset not called in stateless firewall [DotEnv] Remove `usePutEnv` property default value [HttpFoundation] get currently session.gc_maxlifetime if ttl doesnt exists Set up typo fix [DependencyInjection] Handle env var placeholders in CheckTypeDeclarationsPass [Cache] fix memory leak when using PhpArrayAdapter [Validator] Allow underscore character "_" in URL username and password [TwigBridge] Update bootstrap_4_layout.html.twig [FrameworkBundle][SodiumVault] Create secrets directory only when needed fix parsing negative octal numbers [SecurityBundle] Passwords are not encoded when algorithm set to \"true\" [DependencyInjection] Resolve expressions in CheckTypeDeclarationsPass [SecurityBundle] Properly escape regex in AddSessionDomainConstraintPass do not validate passwords when the hash is null [DI] fix resolving bindings for named TypedReference [Config] never try loading failed classes twice with ClassExistenceResource [Mailer] Fix SMTP Authentication when using STARTTLS [DI] Fix making the container path-independent when the app is in /app ...
2 parents 0c280c0 + c5e201a commit 7fcdbce

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

DependencyInjection/Compiler/AddSessionDomainConstraintPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function process(ContainerBuilder $container)
3131
}
3232

3333
$sessionOptions = $container->getParameter('session.storage.options');
34-
$domainRegexp = empty($sessionOptions['cookie_domain']) ? '%s' : sprintf('(?:%%s|(?:.+\.)?%s)', preg_quote(trim($sessionOptions['cookie_domain'], '.')));
34+
$domainRegexp = empty($sessionOptions['cookie_domain']) ? '%%s' : sprintf('(?:%%%%s|(?:.+\.)?%s)', preg_quote(trim($sessionOptions['cookie_domain'], '.')));
3535

3636
if ('auto' === ($sessionOptions['cookie_secure'] ?? null)) {
3737
$secureDomainRegexp = sprintf('{^https://%s$}i', $domainRegexp);

DependencyInjection/Compiler/RegisterTokenUsageTrackingPass.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public function process(ContainerBuilder $container)
4343

4444
if (!$container->has('session')) {
4545
$container->setAlias('security.token_storage', 'security.untracked_token_storage')->setPublic(true);
46+
$container->getDefinition('security.untracked_token_storage')->addTag('kernel.reset', ['method' => 'reset']);
4647
} elseif ($container->hasDefinition('security.context_listener')) {
4748
$container->getDefinition('security.context_listener')
4849
->setArgument(6, [new Reference('security.token_storage'), 'enableUsageTracking']);

DependencyInjection/MainConfiguration.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,13 @@ private function addEncodersSection(ArrayNodeDefinition $rootNode)
362362
->performNoDeepMerging()
363363
->beforeNormalization()->ifString()->then(function ($v) { return ['algorithm' => $v]; })->end()
364364
->children()
365-
->scalarNode('algorithm')->cannotBeEmpty()->end()
365+
->scalarNode('algorithm')
366+
->cannotBeEmpty()
367+
->validate()
368+
->ifTrue(function ($v) { return !\is_string($v); })
369+
->thenInvalid('You must provide a string value.')
370+
->end()
371+
->end()
366372
->arrayNode('migrate_from')
367373
->prototype('scalar')->end()
368374
->beforeNormalization()->castToArray()->end()

0 commit comments

Comments
 (0)