Use this for a configuration like: '%env(INCLUDES_NUMBER_1)%'
Run setup:upgrade
Expected result for the configuration should be somevalue
Actual result: %env(INCLUDES_NUMBER_1)% (literal)
Suggested solution
Update the regex in Semaio\ConfigImportExport\Model\Resolver\EnvironmentVariableResolver
from
'/\%env\((?!PHP_|HTTP_|SERVER_|SCRIPT_|QUERY_|DOCUMENT_)([A-Z\_]{3,})\)\%/'
to
'/\%env\((?!PHP_|HTTP_|SERVER_|SCRIPT_|QUERY_|DOCUMENT_)([A-Z\_0-9]{3,})\)\%/'
And also create a testcase for this
Setup:
putenv('INCLUDES_NUMBER_1=testvalue5');
General
Issue description
Environment variables that include numbers are not parsed.
Steps to reproduce
somevalue
%env(INCLUDES_NUMBER_1)%
(literal)Suggested solution
Update the regex in
Semaio\ConfigImportExport\Model\Resolver\EnvironmentVariableResolver
from'/\%env\((?!PHP_|HTTP_|SERVER_|SCRIPT_|QUERY_|DOCUMENT_)([A-Z\_]{3,})\)\%/'
to'/\%env\((?!PHP_|HTTP_|SERVER_|SCRIPT_|QUERY_|DOCUMENT_)([A-Z\_0-9]{3,})\)\%/'
And also create a testcase for this Setup:
putenv('INCLUDES_NUMBER_1=testvalue5');
Validate:
$this->assertEquals($this->environmentVariableResolver->resolveValue('%env(INCLUDES_NUMBER_1)%'), 'testvalue5');