[BUGFIX] Resolve falsy ENV-variables in YAML Site Configuration values
Using '%env(SOME_VARIABLE)%' within a site configuration YAML did not resolve contents in SOME_VARIABLE that were falsy ('false', '0', 0). This patch now properly converts those falsy values to actual values. Tests are added to verify the new behavior and prevent future regressions. Drive-by fix on Unit tests which did not actually remove env vars after testing, putenv('var') is needed instead of putenv('var='), because the latter will keep the environment var around (with an empty value). Resolves: #91710 Releases: main, 12.4 Change-Id: I99d64f080737ada38fd58a63f4e04e5b0d8c9ef3 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/84442 Reviewed-by:Georg Ringer <georg.ringer@gmail.com> Reviewed-by:
Oliver Klee <typo3-coding@oliverklee.de> Reviewed-by:
Oliver Hader <oliver.hader@typo3.org> Tested-by:
Stefan Bürk <stefan@buerk.tech> Tested-by:
Markus Klein <markus.klein@typo3.org> Tested-by:
core-ci <typo3@b13.com> Tested-by:
Oliver Klee <typo3-coding@oliverklee.de> Reviewed-by:
Stefan Bürk <stefan@buerk.tech> Reviewed-by:
Markus Klein <markus.klein@typo3.org> Tested-by:
Georg Ringer <georg.ringer@gmail.com>
Showing
- typo3/sysext/core/Classes/Configuration/Processor/Placeholder/EnvVariableProcessor.php 1 addition, 1 deletion...figuration/Processor/Placeholder/EnvVariableProcessor.php
- typo3/sysext/core/Tests/Functional/Configuration/Loader/Fixtures/Env/NullAndFalse.yaml 9 additions, 0 deletions...ional/Configuration/Loader/Fixtures/Env/NullAndFalse.yaml
- typo3/sysext/core/Tests/Functional/Configuration/Loader/YamlFileLoaderTest.php 44 additions, 2 deletions...ts/Functional/Configuration/Loader/YamlFileLoaderTest.php
- typo3/sysext/core/Tests/Unit/Configuration/Loader/YamlFileLoaderTest.php 3 additions, 3 deletions...re/Tests/Unit/Configuration/Loader/YamlFileLoaderTest.php
Please register or sign in to comment