Skip to content

Commit 266401c

Browse files
authored
Prefix calls to getenv() during config resolution
1 parent 38e59e0 commit 266401c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

system/Config/BaseConfig.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ protected function initEnvValue(&$property, string $name, string $prefix, string
134134
protected function getEnvValue(string $property, string $prefix, string $shortPrefix)
135135
{
136136
$shortPrefix = ltrim($shortPrefix, '\\');
137+
137138
switch (true)
138139
{
139140
case array_key_exists("{$shortPrefix}.{$property}", $_ENV):
@@ -145,7 +146,9 @@ protected function getEnvValue(string $property, string $prefix, string $shortPr
145146
case array_key_exists("{$prefix}.{$property}", $_SERVER):
146147
return $_SERVER["{$prefix}.{$property}"];
147148
default:
148-
$value = getenv($property);
149+
$value = getenv("{$shortPrefix}.{$property}");
150+
$value = $value === false ? getenv("{$prefix}.{$property}") : $value;
151+
149152
return $value === false ? null : $value;
150153
}
151154
}

0 commit comments

Comments
 (0)