diff --git a/vendor/symfony/cache/Traits/RedisTrait.php b/vendor/symfony/cache/Traits/RedisTrait.php index 518a563..c767330 100644 --- a/vendor/symfony/cache/Traits/RedisTrait.php +++ b/vendor/symfony/cache/Traits/RedisTrait.php @@ -105,9 +105,13 @@ trait RedisTrait throw new CacheException('Cannot find the "redis" extension nor the "predis/predis" package.'); } - $params = preg_replace_callback('#^'.$scheme.':(//)?(?:(?:[^:@]*+:)?([^@]*+)@)?#', function ($m) use (&$auth) { - if (isset($m[2])) { - $auth = rawurldecode($m[2]); + $params = preg_replace_callback('#^'.$scheme.':(//)?(?:(?:(?[^:@]*+):)?(?[^@]*+)@)?#', function ($m) use (&$auth) { + if (isset($m['password'])) { + if (\in_array($m['user'], ['', 'default'], true)) { + $auth = $m['password']; + } else { + $auth = [$m['user'], $m['password']]; + } if ('' === $auth) { $auth = null; @@ -376,7 +380,13 @@ trait RedisTrait $params['parameters']['database'] = $params['dbindex']; } if (null !== $auth) { - $params['parameters']['password'] = $auth; + if (\is_array($auth)) { + // ACL + $params['parameters']['username'] = $auth[0]; + $params['parameters']['password'] = $auth[1]; + } else { + $params['parameters']['password'] = $auth; + } } if (isset($params['ssl'])) {