[DI] made the %env(base64:...)%
processor able to decode base64url
This commit is contained in:
parent
f5cef028f8
commit
3d12e46692
@ -14,6 +14,7 @@ CHANGELOG
|
||||
* added ability to define a static priority method for tagged service
|
||||
* added support for improved syntax to define method calls in Yaml
|
||||
* added `LazyString` for lazy computation of string values injected into services
|
||||
* made the `%env(base64:...)%` processor able to decode base64url
|
||||
|
||||
4.3.0
|
||||
-----
|
||||
|
@ -173,7 +173,7 @@ class EnvVarProcessor implements EnvVarProcessorInterface
|
||||
}
|
||||
|
||||
if ('base64' === $prefix) {
|
||||
return base64_decode($env);
|
||||
return base64_decode(strtr($env, '-_', '+/'));
|
||||
}
|
||||
|
||||
if ('json' === $prefix) {
|
||||
|
@ -231,6 +231,12 @@ class EnvVarProcessorTest extends TestCase
|
||||
});
|
||||
|
||||
$this->assertSame('hello', $result);
|
||||
|
||||
$result = $processor->getEnv('base64', 'foo', function ($name) { return '/+0='; });
|
||||
$this->assertSame("\xFF\xED", $result);
|
||||
|
||||
$result = $processor->getEnv('base64', 'foo', function ($name) { return '_-0='; });
|
||||
$this->assertSame("\xFF\xED", $result);
|
||||
}
|
||||
|
||||
public function testGetEnvTrim()
|
||||
|
Reference in New Issue
Block a user