Skip to content

Commit 9e3e44f

Browse files
Jeroen van den NieuwenhuisenRobin Chalas
authored andcommitted
[SecurityBundle] Passwords are not encoded when algorithm set to \"true\"
1 parent 59b442b commit 9e3e44f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

DependencyInjection/MainConfiguration.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,13 @@ private function addEncodersSection(ArrayNodeDefinition $rootNode)
421421
->performNoDeepMerging()
422422
->beforeNormalization()->ifString()->then(function ($v) { return ['algorithm' => $v]; })->end()
423423
->children()
424-
->scalarNode('algorithm')->cannotBeEmpty()->end()
424+
->scalarNode('algorithm')
425+
->cannotBeEmpty()
426+
->validate()
427+
->ifTrue(function ($v) { return !\is_string($v); })
428+
->thenInvalid('You must provide a string value.')
429+
->end()
430+
->end()
425431
->scalarNode('hash_algorithm')->info('Name of hashing algorithm for PBKDF2 (i.e. sha256, sha512, etc..) See hash_algos() for a list of supported algorithms.')->defaultValue('sha512')->end()
426432
->scalarNode('key_length')->defaultValue(40)->end()
427433
->booleanNode('ignore_case')->defaultFalse()->end()

0 commit comments

Comments
 (0)