Skip to content

Commit aea85f5

Browse files
andreyserdjuknicolas-grekas
authored andcommitted
[DependencyInjection] More predictable EnvVarProcessor CSV empty string parsing
1 parent 24b1b02 commit aea85f5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Symfony/Component/DependencyInjection/EnvVarProcessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ public function getEnv(string $prefix, string $name, \Closure $getEnv): mixed
313313
}
314314

315315
if ('csv' === $prefix) {
316-
return str_getcsv($env, ',', '"', '');
316+
return '' === $env ? [] : str_getcsv($env, ',', '"', '');
317317
}
318318

319319
if ('trim' === $prefix) {

src/Symfony/Component/DependencyInjection/Tests/EnvVarProcessorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ public static function validCsv()
714714
CSV;
715715

716716
return [
717-
['', [null]],
717+
['', []],
718718
[',', ['', '']],
719719
['1', ['1']],
720720
['1,2," 3 "', ['1', '2', ' 3 ']],

0 commit comments

Comments
 (0)