diff --git a/framework/caching/CRedisCache.php b/framework/caching/CRedisCache.php index 5a1781c208..28d22a67a2 100644 --- a/framework/caching/CRedisCache.php +++ b/framework/caching/CRedisCache.php @@ -101,8 +101,8 @@ protected function connect() { if($this->ssl) stream_socket_enable_crypto($this->_socket,true,STREAM_CRYPTO_METHOD_TLS_CLIENT); - if($this->password!==null || $this->username!==null){ - if(isset($this->username)) + if($this->password!==null){ + if($this->username!==null) $this->executeCommand('AUTH',array($this->username, $this->password)); else $this->executeCommand('AUTH',array($this->password));