From d898ccd8e014a23d5a67c3dd610ecf23f2b4515f Mon Sep 17 00:00:00 2001 From: megatank58 Date: Sun, 9 Oct 2022 11:29:00 +0530 Subject: [PATCH 1/3] fix: correctly handle `=` in .env --- src/Appwrite/Docker/Env.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Appwrite/Docker/Env.php b/src/Appwrite/Docker/Env.php index 19979eb0ce..bce12a95e6 100644 --- a/src/Appwrite/Docker/Env.php +++ b/src/Appwrite/Docker/Env.php @@ -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; From d1e9e7b3969d981188d481d0a8e74c0024590438 Mon Sep 17 00:00:00 2001 From: megatank58 Date: Mon, 17 Oct 2022 16:01:28 +0530 Subject: [PATCH 2/3] chore(tests): update .env --- tests/resources/docker/.env | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/resources/docker/.env b/tests/resources/docker/.env index 1c1359f0fe..b619ab8915 100644 --- a/tests/resources/docker/.env +++ b/tests/resources/docker/.env @@ -1,3 +1,4 @@ _APP_X=value1 _APP_Y=value2 -_APP_Z = value3 \ No newline at end of file +_APP_Z = value3 +_APP_W = value5= From 819ba458366489fea897b6a915796e6a70fd9d01 Mon Sep 17 00:00:00 2001 From: megatank58 Date: Mon, 17 Oct 2022 16:02:24 +0530 Subject: [PATCH 3/3] chore(tests): add test case for value ending in = --- tests/unit/Docker/EnvTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unit/Docker/EnvTest.php b/tests/unit/Docker/EnvTest.php index f085d62e56..6730491438 100644 --- a/tests/unit/Docker/EnvTest.php +++ b/tests/unit/Docker/EnvTest.php @@ -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')); }