From 1ab4253abc75118e31acd5d4a8c5ff4127f37ce9 Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Sun, 31 Dec 2023 10:34:28 +0100 Subject: [PATCH] [Cache][DependencyInjection][Lock][Mailer][Messenger][Notifier][Translation] Url decode username and passwords from `parse_url()` results --- Store/MongoDbStore.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Store/MongoDbStore.php b/Store/MongoDbStore.php index d645a01..f8683c8 100644 --- a/Store/MongoDbStore.php +++ b/Store/MongoDbStore.php @@ -137,10 +137,10 @@ public function __construct($mongo, array $options = [], float $initialTtl = 300 */ private function skimUri(string $uri): string { - if (false === $parsedUrl = parse_url($uri)) { + if (false === $params = parse_url($uri)) { throw new InvalidArgumentException(sprintf('The given MongoDB Connection URI "%s" is invalid.', $uri)); } - $pathDb = ltrim($parsedUrl['path'] ?? '', '/') ?: null; + $pathDb = ltrim($params['path'] ?? '', '/') ?: null; if (null !== $pathDb) { $this->options['database'] = $pathDb; }