Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: symfony/cache
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v6.0.17
Choose a base ref
...
head repository: symfony/cache
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v6.0.18
Choose a head ref
  • 4 commits
  • 1 file changed
  • 2 contributors

Commits on Dec 29, 2022

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    fa69c51 View commit details
  2. Merge branch '5.4' into 6.0

    * 5.4:
      fix for caching without auth parameter, broken by #48711, fix for #48813
      Bump Symfony version to 5.4.18
      Update VERSION for 5.4.17
      Update CONTRIBUTORS for 5.4.17
      Update CHANGELOG for 5.4.17
    chalasr committed Dec 29, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5aba102 View commit details
  3. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a33fa08 View commit details
  4. Merge branch '5.4' into 6.0

    * 5.4:
      [Cache] Fix possibly null value passed to preg_match() in RedisTrait
    chalasr committed Dec 29, 2022
    Copy the full SHA
    079ec0a View commit details
Showing with 12 additions and 6 deletions.
  1. +12 −6 Traits/RedisTrait.php
18 changes: 12 additions & 6 deletions Traits/RedisTrait.php
Original file line number Diff line number Diff line change
@@ -197,8 +197,11 @@ public static function createConnection(string $dsn, array $options = []): \Redi
if (!isset($params['redis_sentinel'])) {
break;
}

$sentinel = new \RedisSentinel($host, $port, $params['timeout'], (string) $params['persistent_id'], $params['retry_interval'], $params['read_timeout'], ...\defined('Redis::OPT_NULL_MULTIBULK_AS_NULL') ? [$params['auth'] ?? ''] : []);
$extra = [];
if (\defined('Redis::OPT_NULL_MULTIBULK_AS_NULL') && isset($params['auth'])) {
$extra = [$params['auth']];
}
$sentinel = new \RedisSentinel($host, $port, $params['timeout'], (string) $params['persistent_id'], $params['retry_interval'], $params['read_timeout'], ...$extra);

if ($address = $sentinel->getMasterAddrByName($params['redis_sentinel'])) {
[$host, $port] = $address;
@@ -210,10 +213,13 @@ public static function createConnection(string $dsn, array $options = []): \Redi
}

try {
@$redis->{$connect}($host, $port, $params['timeout'], (string) $params['persistent_id'], $params['retry_interval'], $params['read_timeout'], ...\defined('Redis::SCAN_PREFIX') ? [[
'auth' => $params['auth'] ?? '',
$extra = [
'stream' => $params['ssl'] ?? null,
]] : []);
];
if (isset($params['auth'])) {
$extra['auth'] = $params['auth'];
}
@$redis->{$connect}($host, $port, $params['timeout'], (string) $params['persistent_id'], $params['retry_interval'], $params['read_timeout'], ...\defined('Redis::SCAN_PREFIX') ? [$extra] : []);

set_error_handler(function ($type, $msg) use (&$error) { $error = $msg; });
try {
@@ -222,7 +228,7 @@ public static function createConnection(string $dsn, array $options = []): \Redi
restore_error_handler();
}
if (!$isConnected) {
$error = preg_match('/^Redis::p?connect\(\): (.*)/', $error, $error) ? sprintf(' (%s)', $error[1]) : '';
$error = preg_match('/^Redis::p?connect\(\): (.*)/', $error ?? '', $error) ? sprintf(' (%s)', $error[1]) : '';
throw new InvalidArgumentException(sprintf('Redis connection "%s" failed: ', $dsn).$error.'.');
}