10000 [DI] made the `%env(base64:...)%` processor able to decode base64url by nicolas-grekas · Pull Request #34014 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[DI] made the %env(base64:...)% processor able to decode base64url #34014

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Symfony/Component/DependencyInjection/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public function getEnv($prefix, $name, \Closure $getEnv)
}

if ('base64' === $prefix) {
return base64_decode($env);
return base64_decode(strtr($env, '-_', '+/'));
}

if ('json' === $prefix) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,12 @@ public function testGetEnvBase64()
});

$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()
Expand Down
0