diff --git a/src/Symfony/Component/Dotenv/Dotenv.php b/src/Symfony/Component/Dotenv/Dotenv.php index 00f27bb7b3..2e907b8c98 100644 --- a/src/Symfony/Component/Dotenv/Dotenv.php +++ b/src/Symfony/Component/Dotenv/Dotenv.php @@ -351,7 +351,7 @@ final class Dotenv } $name = $matches[3]; - $value = isset($this->values[$name]) ? $this->values[$name] : (isset($_ENV[$name]) ? isset($_ENV[$name]) : (string) getenv($name)); + $value = isset($this->values[$name]) ? $this->values[$name] : (isset($_ENV[$name]) ? $_ENV[$name] : (string) getenv($name)); if (!$matches[2] && isset($matches[4])) { $value .= '}'; diff --git a/src/Symfony/Component/Dotenv/Tests/DotenvTest.php b/src/Symfony/Component/Dotenv/Tests/DotenvTest.php index a7f211ecd6..47598030a8 100644 --- a/src/Symfony/Component/Dotenv/Tests/DotenvTest.php +++ b/src/Symfony/Component/Dotenv/Tests/DotenvTest.php @@ -63,6 +63,7 @@ class DotenvTest extends TestCase public function getEnvData() { putenv('LOCAL=local'); + $_ENV['REMOTE'] = 'remote'; $tests = array( // spaces @@ -134,6 +135,7 @@ class DotenvTest extends TestCase array('FOO=" \\$ "', array('FOO' => ' $ ')), array('FOO=" $ "', array('FOO' => ' $ ')), array('BAR=$LOCAL', array('BAR' => 'local')), + array('BAR=$REMOTE', array('BAR' => 'remote')), array('FOO=$NOTDEFINED', array('FOO' => '')), );