From: Philipp Date: Tue, 15 Feb 2022 22:04:43 +0000 (+0100) Subject: Don't use empty, but not null values for redis password and port X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4e58c6981cf1e57ed0d07dfb174b6f27ef0736e3;p=friendica.git Don't use empty, but not null values for redis password and port --- diff --git a/src/Core/Cache/Type/RedisCache.php b/src/Core/Cache/Type/RedisCache.php index a58936cfc9..a3a5cf7c84 100644 --- a/src/Core/Cache/Type/RedisCache.php +++ b/src/Core/Cache/Type/RedisCache.php @@ -59,13 +59,13 @@ class RedisCache extends AbstractCache implements ICanCacheInMemory $redis_pw = $config->get('system', 'redis_password'); $redis_db = $config->get('system', 'redis_db', 0); - if (isset($redis_port) && !@$this->redis->connect($redis_host, $redis_port)) { + if (!empty($redis_port) && !@$this->redis->connect($redis_host, $redis_port)) { throw new CachePersistenceException('Expected Redis server at ' . $redis_host . ':' . $redis_port . ' isn\'t available'); } elseif (!@$this->redis->connect($redis_host)) { throw new CachePersistenceException('Expected Redis server at ' . $redis_host . ' isn\'t available'); } - if (isset($redis_pw) && !$this->redis->auth($redis_pw)) { + if (!empty($redis_pw) && !$this->redis->auth($redis_pw)) { throw new CachePersistenceException('Cannot authenticate redis server at ' . $redis_host . ':' . $redis_port); }