Merge pull request #4341 from megatank58/patch-1
fix: correctly handle `=` in .env
This commit is contained in:
commit
37ce513b87
3 changed files with 4 additions and 2 deletions
|
@ -19,7 +19,7 @@ class Env
|
|||
$data = explode("\n", $data);
|
||||
|
||||
foreach ($data as &$row) {
|
||||
$row = explode('=', $row);
|
||||
$row = explode('=', $row, 2);
|
||||
$key = (isset($row[0])) ? trim($row[0]) : null;
|
||||
$value = (isset($row[1])) ? trim($row[1]) : null;
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
_APP_X=value1
|
||||
_APP_Y=value2
|
||||
_APP_Z = value3
|
||||
_APP_Z = value3
|
||||
_APP_W = value5=
|
||||
|
|
|
@ -28,6 +28,7 @@ class EnvTest extends TestCase
|
|||
$this->assertEquals('value1', $this->object->getVar('_APP_X'));
|
||||
$this->assertEquals('value2', $this->object->getVar('_APP_Y'));
|
||||
$this->assertEquals('value3', $this->object->getVar('_APP_Z'));
|
||||
$this->assertEquals('value5=', $this->object->getVar('_APP_W'));
|
||||
$this->assertEquals('value4', $this->object->getVar('_APP_TEST'));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue