Skip to content

Commit 7da0312

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

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

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

Lines changed: 16 additions & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy