8000 Throw exception before normalization on invalid cipher · symfony/symfony@eb6c711 · GitHub
[go: up one dir, main page]

Skip to content

Commit eb6c711

Browse files
Throw exception before normalization on invalid cipher
1 parent d5eb5a6 commit eb6c711

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2299,7 +2299,14 @@ private function addMailerSection(ArrayNodeDefinition $rootNode, callable $enabl
22992299
->defaultNull()
23002300
->beforeNormalization()
23012301
->always(function ($v): ?int {
2302-
return null !== $v && \defined('OPENSSL_CIPHER_'.$v) ? \constant('OPENSSL_CIPHER_'.$v) : null;
2302+
if (null === $v) {
2303+
return null;
2304+
}
2305+
if (\defined('OPENSSL_CIPHER_'.$v)) {
2306+
return \constant('OPENSSL_CIPHER_'.$v);
2307+
}
2308+
2309+
throw new \InvalidArgumentException(\sprintf('"%s" is not a valid OPENSSL cipher.', $v));
23032310
})
23042311
->end()
23052312
->validate()

0 commit comments

Comments
 (0)
0