Skip to content

Commit

Permalink
Merge branch '6.3' into 6.4
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
nicolas-grekas committed Jan 2, 2024
2 parents fc31efa + bc4a79b commit 1eaec83
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Transport/Dsn.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,25 @@ public function __construct(#[\SensitiveParameter] string $dsn)
{
$this->originalDsn = $dsn;

if (false === $parsedDsn = parse_url($dsn)) {
if (false === $params = parse_url($dsn)) {
throw new InvalidArgumentException('The notifier DSN is invalid.');
}

if (!isset($parsedDsn['scheme'])) {
if (!isset($params['scheme'])) {
throw new InvalidArgumentException('The notifier DSN must contain a scheme.');
}
$this->scheme = $parsedDsn['scheme'];
$this->scheme = $params['scheme'];

if (!isset($parsedDsn['host'])) {
if (!isset($params['host'])) {
throw new InvalidArgumentException('The notifier DSN must contain a host (use "default" by default).');
}
$this->host = $parsedDsn['host'];
$this->host = $params['host'];

$this->user = '' !== ($parsedDsn['user'] ?? '') ? urldecode($parsedDsn['user']) : null;
$this->password = '' !== ($parsedDsn['pass'] ?? '') ? urldecode($parsedDsn['pass']) : null;
$this->port = $parsedDsn['port'] ?? null;
$this->path = $parsedDsn['path'] ?? null;
parse_str($parsedDsn['query'] ?? '', $this->options);
$this->user = '' !== ($params['user'] ?? '') ? rawurldecode($params['user']) : null;
$this->password = '' !== ($params['pass'] ?? '') ? rawurldecode($params['pass']) : null;
$this->port = $params['port'] ?? null;
$this->path = $params['path'] ?? null;
parse_str($params['query'] ?? '', $this->options);
}

public function getScheme(): string
Expand Down

0 comments on commit 1eaec83

Please sign in to comment.