Skip to content

Commit 3ec9e2f

Browse files
committed
Fix filter_var on persistent
1 parent 94630e0 commit 3ec9e2f

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

system/Session/Handlers/RedisHandler.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ protected function setSavePath(): void
142142
}
143143
}
144144

145-
$persistent = filter_var($query['persistent'], FILTER_VALIDATE_BOOL) ? (bool) $query['persistent'] : null;
145+
$persistent = isset($query['persistent']) ? filter_var($query['persistent'], FILTER_VALIDATE_BOOL) : null;
146146
$password = $query['auth'] ?? null;
147147
$database = isset($query['database']) ? (int) $query['database'] : 0;
148148
$timeout = isset($query['timeout']) ? (float) $query['timeout'] : 0.0;
@@ -180,13 +180,7 @@ public function open($path, $name): bool
180180

181181
$funcConnection = isset($this->savePath['persistent']) && $this->savePath['persistent'] ? 'pconnect' : 'connect';
182182

183-
if (
184-
! $redis->{$funcConnection}(
185-
$this->savePath['host'],
186-
$this->savePath['port'],
187-
$this->savePath['timeout'],
188-
)
189-
) {
183+
if (! $redis->{$funcConnection}($this->savePath['host'], $this->savePath['port'], $this->savePath['timeout'])) {
190184
$this->logger->error('Session: Unable to connect to Redis with the configured settings.');
191185
} elseif (isset($this->savePath['password']) && ! $redis->auth($this->savePath['password'])) {
192186
$this->logger->error('Session: Unable to authenticate to Redis instance.');

0 commit comments

Comments
 (0)