8000 [DI] Validate env vars in config by ro0NL · Pull Request #23888 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[DI] Validate env vars in config #23888

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

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
feedback
  • Loading branch information
ro0NL committed Mar 22, 2018
commit e7b965611666d56bc05ab05f695cfc7b93cf26e4
4 changes: 2 additions & 2 deletions src/Symfony/Component/Config/Definition/BaseNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ private static function resolvePlaceholderValue($value)
return self::$placeholders[$value];
}

if (0 === strpos($value, self::$placeholderUniquePrefix, 0)) {
if (0 === strpos($value, self::$placeholderUniquePrefix)) {
return array();
}
}
Expand All @@ -493,7 +493,7 @@ private static function resolvePlaceholderValue($value)

private static function getType($value): string
{
switch ($type = gettype($value)) {
switch ($type = \gettype($value)) {
case 'boolean':
return 'bool';
case 'double':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function process(ContainerBuilder $container)

private static function getType($value): string
{
switch ($type = gettype($value)) {
switch ($type = \gettype($value)) {
case 'boolean':
return 'bool';
case 'double':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function get($name)
*/
public function getEnvPlaceholderUniquePrefix(): string
{
return $this->envPlaceholderUniquePrefix ?? $this->envPlaceholderUniquePrefix = 'env_'.bin2hex(random_bytes(16));
return $this->envPlaceholderUniquePrefix ?? $this->envPlaceholderUniquePrefix = 'env_'.bin2hex(random_bytes(8));
}

/**
Expand Down
0