Skip to content

Commit

Permalink
bug #20026 [Cache] Fixed password used to make the redis connection. …
Browse files Browse the repository at this point in the history
…(ErikSaunier)

This PR was merged into the 3.1 branch.

Discussion
----------

[Cache] Fixed password used to make the redis connection.

| Q             | A
| ------------- | ---
| Branch?       | 3.1
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #20025
| License       | MIT
| Doc PR        | http://symfony.com/blog/new-in-symfony-3-1-cache-component

I do not know if it's possible to provide a test as `REDIS_HOST` is provided by Travis in [RedisAdapterTest.php](https://github.com/symfony/symfony/blob/3.1/src/Symfony/Component/Cache/Tests/Adapter/RedisAdapterTest.php).

Commits
-------

77eea43 [Cache] Fix password used to make the redis connection.
  • Loading branch information
fabpot committed Sep 23, 2016
2 parents b23389d + 77eea43 commit 23eee70
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Symfony/Component/Cache/Adapter/RedisAdapter.php
Expand Up @@ -69,7 +69,7 @@ public static function createConnection($dsn, array $options = array())
if (0 !== strpos($dsn, 'redis://')) {
throw new InvalidArgumentException(sprintf('Invalid Redis DSN: %s does not start with "redis://"', $dsn));
}
$params = preg_replace_callback('#^redis://(?:([^@]*)@)?#', function ($m) use (&$auth) {
$params = preg_replace_callback('#^redis://(?:(?:[^:@]*+:)?([^@]*+)@)?#', function ($m) use (&$auth) {
if (isset($m[1])) {
$auth = $m[1];
}
Expand Down

0 comments on commit 23eee70

Please sign in to comment.