8000 explicitly cast boolean SSL stream options · symfony/symfony@fe91122 · GitHub
[go: up one dir, main page]

Skip to content

Commit fe91122

Browse files
committed
explicitly cast boolean SSL stream options
1 parent 8306a88 commit fe91122

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/Symfony/Component/Cache/Traits/RedisTrait.php

+16
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,22 @@ public static function createConnection(string $dsn, array $options = [])
250250
$extra = [
251251
'stream' => $params['ssl'] ?? null,
252252
];
253+
$booleanStreamOptions = [
254+
'allow_self_signed',
255+
'capture_peer_cert',
256+
'capture_peer_cert_chain',
257+
'disable_compression',
258+
'SNI_enabled',
259+
'verify_peer',
260+
'verify_peer_name',
261+
];
262+
263+
foreach ($extra['stream'] ?? [] as $streamOption => $value) {
264+
if (\in_array($streamOption, $booleanStreamOptions, true) && \is_string($value)) {
265+
$extra['stream'][$streamOption] = filter_var($value, \FILTER_VALIDATE_BOOL);
266+
}
267+
}
268+
253269
if (isset($params['auth'])) {
254270
$extra['auth'] = $params['auth'];
255271
}

0 commit comments

Comments
 (0)
0