Skip to content

Commit adbc498

Browse files
committed
Merge branch '7.0' into 7.1
* 7.0: fix lowest deps synchronize RelayProxy [Form] Adding more `@var` PHPDoc's to silence psalm [Validator] added missing Hungarian translation [Validator] add missing lv translation fix the exception being thrown fix syntax error fix redis messenger scheme comparison [Scheduler] Separate id and description in message providers [Form] Adding `@var` PHPDoc to silence psalm 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 8463c3a + 2a3c955 commit adbc498

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

EnvVarProcessor.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -287,15 +287,15 @@ public function getEnv(string $prefix, string $name, \Closure $getEnv): mixed
287287
}
288288

289289
if ('url' === $prefix) {
290-
$parsedEnv = parse_url($env);
290+
$params = parse_url($env);
291291

292-
if (false === $parsedEnv) {
292+
if (false === $params) {
293293
throw new RuntimeException(sprintf('Invalid URL in env var "%s".', $name));
294294
}
295-
if (!isset($parsedEnv['scheme'], $parsedEnv['host'])) {
295+
if (!isset($params['scheme'], $params['host'])) {
296296
throw new RuntimeException(sprintf('Invalid URL env var "%s": schema and host expected, "%s" given.', $name, $env));
297297
}
298-
$parsedEnv += [
298+
$params += [
299299
'port' => null,
300300
'user' => null,
301301
'pass' => null,
@@ -304,10 +304,13 @@ public function getEnv(string $prefix, string $name, \Closure $getEnv): mixed
304304
'fragment' => null,
305305
];
306306

307+
$params['user'] = null !== $params['user'] ? rawurldecode($params['user']) : null;
308+
$params['pass'] = null !== $params['pass'] ? rawurldecode($params['pass']) : null;
309+
307310
// remove the '/' separator
308-
$parsedEnv['path'] = '/' === ($parsedEnv['path'] ?? '/') ? '' : substr($parsedEnv['path'], 1);
311+
$params['path'] = '/' === ($params['path'] ?? '/') ? '' : substr($params['path'], 1);
309312

310-
return $parsedEnv;
313+
return $params;
311314
}
312315

313316
if ('query_string' === $prefix) {

0 commit comments

Comments
 (0)