Skip to content

Commit 1ab4253

Browse files
alexandre-dauboisnicolas-grekas
authored andcommitted
[Cache][DependencyInjection][Lock][Mailer][Messenger][Notifier][Translation] Url decode username and passwords from parse_url() results
1 parent 26ff165 commit 1ab4253

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Store/MongoDbStore.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,10 @@ public function __construct($mongo, array $options = [], float $initialTtl = 300
137137
*/
138138
private function skimUri(string $uri): string
139139
{
140-
if (false === $parsedUrl = parse_url($uri)) {
140+
if (false === $params = parse_url($uri)) {
141141
throw new InvalidArgumentException(sprintf('The given MongoDB Connection URI "%s" is invalid.', $uri));
142142
}
143-
$pathDb = ltrim($parsedUrl['path'] ?? '', '/') ?: null;
143+
$pathDb = ltrim($params['path'] ?? '', '/') ?: null;
144144
if (null !== $pathDb) {
145145
$this->options['database'] = $pathDb;
146146
}

0 commit comments

Comments
 (0)