From 3f52221830721996b468198534aba2389b8dbfc5 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 23 Jan 2023 14:36:51 +0100 Subject: [PATCH 1/3] Remove full DSNs from exception messages --- Session/Storage/Handler/SessionHandlerFactory.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Session/Storage/Handler/SessionHandlerFactory.php b/Session/Storage/Handler/SessionHandlerFactory.php index 39dc30c6f..14454d0b8 100644 --- a/Session/Storage/Handler/SessionHandlerFactory.php +++ b/Session/Storage/Handler/SessionHandlerFactory.php @@ -63,7 +63,7 @@ public static function createHandler($connection): AbstractSessionHandler case str_starts_with($connection, 'rediss:'): case str_starts_with($connection, 'memcached:'): if (!class_exists(AbstractAdapter::class)) { - throw new \InvalidArgumentException(sprintf('Unsupported DSN "%s". Try running "composer require symfony/cache".', $connection)); + throw new \InvalidArgumentException('Unsupported Redis or Memcached DSN. Try running "composer require symfony/cache".'); } $handlerClass = str_starts_with($connection, 'memcached:') ? MemcachedSessionHandler::class : RedisSessionHandler::class; $connection = AbstractAdapter::createConnection($connection, ['lazy' => true]); @@ -72,7 +72,7 @@ public static function createHandler($connection): AbstractSessionHandler case str_starts_with($connection, 'pdo_oci://'): if (!class_exists(DriverManager::class)) { - throw new \InvalidArgumentException(sprintf('Unsupported DSN "%s". Try running "composer require doctrine/dbal".', $connection)); + throw new \InvalidArgumentException('Unsupported PDO OCI DSN. Try running "composer require doctrine/dbal".'); } $connection[3] = '-'; $params = class_exists(DsnParser::class) ? (new DsnParser())->parse($connection) : ['url' => $connection]; From 7a12bc1dade63deb74dc04a82f157a3a944b0eb8 Mon Sep 17 00:00:00 2001 From: HypeMC Date: Sun, 5 Nov 2023 18:18:30 +0100 Subject: [PATCH 2/3] [Cache][HttpFoundation][Lock] Fix empty username/password for PDO PostgreSQL --- Session/Storage/Handler/PdoSessionHandler.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Session/Storage/Handler/PdoSessionHandler.php b/Session/Storage/Handler/PdoSessionHandler.php index cad7e0a72..f9c5d9b59 100644 --- a/Session/Storage/Handler/PdoSessionHandler.php +++ b/Session/Storage/Handler/PdoSessionHandler.php @@ -112,16 +112,16 @@ class PdoSessionHandler extends AbstractSessionHandler /** * Username when lazy-connect. * - * @var string + * @var string|null */ - private $username = ''; + private $username = null; /** * Password when lazy-connect. * - * @var string + * @var string|null */ - private $password = ''; + private $password = null; /** * Connection options when lazy-connect. From 4fbe1337a0309e117cc508906cdeb47900366d6c Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Thu, 2 Nov 2023 12:02:02 +0100 Subject: [PATCH 3/3] ensure string type with mbstring func overloading enabled --- HeaderUtils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HeaderUtils.php b/HeaderUtils.php index f91c7e1d9..3456edace 100644 --- a/HeaderUtils.php +++ b/HeaderUtils.php @@ -256,7 +256,7 @@ public static function parseQuery(string $query, bool $ignoreBrackets = false, s private static function groupParts(array $matches, string $separators, bool $first = true): array { $separator = $separators[0]; - $separators = substr($separators, 1); + $separators = substr($separators, 1) ?: ''; $i = 0; if ('' === $separators && !$first) {