Skip to content

Commit 134cda8

Browse files
Merge branch '6.3' into 6.4
* 6.3: append instead of replacing potentially non-existent named-arguments [Validator] added missing Polish translation add translations for the MacAddress constraint remove invalid changelog entry Added missing Serbian (sr_Latn) translations [Cache][DependencyInjection][Lock][Mailer][Messenger][Notifier][Translation] Url decode username and passwords from `parse_url()` results [Security] added missing Albanian translations [Validator] Add missing Hungarian translation [Serializer] Fix using deserialization path [Validator] Add missing hr translation
2 parents 6da89e5 + 024ce0b commit 134cda8

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Transport/Dsn.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,24 @@ public function __construct(string $scheme, string $host, string $user = null, #
3737

3838
public static function fromString(#[\SensitiveParameter] string $dsn): self
3939
{
40-
if (false === $parsedDsn = parse_url($dsn)) {
40+
if (false === $params = parse_url($dsn)) {
4141
throw new InvalidArgumentException('The mailer DSN is invalid.');
4242
}
4343

44-
if (!isset($parsedDsn['scheme'])) {
44+
if (!isset($params['scheme'])) {
4545
throw new InvalidArgumentException('The mailer DSN must contain a scheme.');
4646
}
4747

48-
if (!isset($parsedDsn['host'])) {
48+
if (!isset($params['host'])) {
4949
throw new InvalidArgumentException('The mailer DSN must contain a host (use "default" by default).');
5050
}
5151

52-
$user = '' !== ($parsedDsn['user'] ?? '') ? urldecode($parsedDsn['user']) : null;
53-
$password = '' !== ($parsedDsn['pass'] ?? '') ? urldecode($parsedDsn['pass']) : null;
54-
$port = $parsedDsn['port'] ?? null;
55-
parse_str($parsedDsn['query'] ?? '', $query);
52+
$user = '' !== ($params['user'] ?? '') ? rawurldecode($params['user']) : null;
53+
$password = '' !== ($params['pass'] ?? '') ? rawurldecode($params['pass']) : null;
54+
$port = $params['port'] ?? null;
55+
parse_str($params['query'] ?? '', $query);
5656

57-
return new self($parsedDsn['scheme'], $parsedDsn['host'], $user, $password, $port, $query);
57+
return new self($params['scheme'], $params['host'], $user, $password, $port, $query);
5858
}
5959

6060
public function getScheme(): string

0 commit comments

Comments
 (0)