diff --git a/app/executor.php b/app/executor.php index 31f1738f53..a38837bb19 100644 --- a/app/executor.php +++ b/app/executor.php @@ -497,12 +497,12 @@ App::post('/v1/execution') $functionStatus = ($statusCode >= 200 && $statusCode < 300) ? 'completed' : 'failed'; Console::success('Function executed in ' . $executionTime . ' seconds, status: ' . $functionStatus); - + $execution = [ 'status' => $functionStatus, 'statusCode' => $statusCode, - 'stdout' => \mb_strcut(\utf8_encode($stdout), 0, 1000000), // Limit to 1MB - 'stderr' => \mb_strcut(\utf8_encode($stderr), 0, 1000000), // Limit to 1MB + 'stdout' => \mb_strcut($stdout, 0, 1000000), // Limit to 1MB + 'stderr' => \mb_strcut($stderr, 0, 1000000), // Limit to 1MB 'time' => $executionTime, ]; diff --git a/composer.lock b/composer.lock index 291b391b3e..6d0f8a2f45 100644 --- a/composer.lock +++ b/composer.lock @@ -2247,16 +2247,16 @@ }, { "name": "utopia-php/framework", - "version": "0.19.7", + "version": "0.19.20", "source": { "type": "git", "url": "https://github.com/utopia-php/framework.git", - "reference": "f17afe77a21873b9be18ebc05283813468b4283a" + "reference": "65ced168db8f6e188ceeb0d101f57552c3d8b2af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/framework/zipball/f17afe77a21873b9be18ebc05283813468b4283a", - "reference": "f17afe77a21873b9be18ebc05283813468b4283a", + "url": "https://api.github.com/repos/utopia-php/framework/zipball/65ced168db8f6e188ceeb0d101f57552c3d8b2af", + "reference": "65ced168db8f6e188ceeb0d101f57552c3d8b2af", "shasum": "" }, "require": { @@ -2290,9 +2290,9 @@ ], "support": { "issues": "https://github.com/utopia-php/framework/issues", - "source": "https://github.com/utopia-php/framework/tree/0.19.7" + "source": "https://github.com/utopia-php/framework/tree/0.19.20" }, - "time": "2022-02-18T00:04:49+00:00" + "time": "2022-04-14T15:42:37+00:00" }, { "name": "utopia-php/image", diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index e26f93ad34..6e3c09d23e 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -513,7 +513,7 @@ class FunctionsCustomServerTest extends Scope $this->assertStringContainsString('http', $execution['body']['stdout']); $this->assertStringContainsString('PHP', $execution['body']['stdout']); $this->assertStringContainsString('8.0', $execution['body']['stdout']); - // $this->assertStringContainsString('êä', $execution['body']['stdout']); // tests unknown utf-8 chars + $this->assertStringContainsString('êä', $execution['body']['stdout']); // tests unknown utf-8 chars $this->assertEquals('', $execution['body']['stderr']); $this->assertLessThan(0.500, $execution['body']['time']); @@ -601,7 +601,7 @@ class FunctionsCustomServerTest extends Scope $this->assertStringContainsString('http', $execution['body']['stdout']); $this->assertStringContainsString('PHP', $execution['body']['stdout']); $this->assertStringContainsString('8.0', $execution['body']['stdout']); - // $this->assertStringContainsString('êä', $execution['body']['sdtout']); // tests unknown utf-8 chars + $this->assertStringContainsString('êä', $execution['body']['sdtout']); // tests unknown utf-8 chars $this->assertLessThan(0.500, $execution['body']['time']); return $data; diff --git a/tests/resources/functions/php-large/index.php b/tests/resources/functions/php-large/index.php index dd111af766..8bd0de5e60 100644 --- a/tests/resources/functions/php-large/index.php +++ b/tests/resources/functions/php-large/index.php @@ -10,6 +10,6 @@ return function ($request, $response) { 'APPWRITE_FUNCTION_RUNTIME_VERSION' => $request['env']['APPWRITE_FUNCTION_RUNTIME_VERSION'], 'APPWRITE_FUNCTION_EVENT' => $request['env']['APPWRITE_FUNCTION_EVENT'], 'APPWRITE_FUNCTION_EVENT_DATA' => $request['env']['APPWRITE_FUNCTION_EVENT_DATA'], - 'UNICODE_TEST' => "êä" // TODO: Re-add unicode test to FunctionsCustomServerTest.php + 'UNICODE_TEST' => "êä" ]); }; diff --git a/tests/resources/functions/php/index.php b/tests/resources/functions/php/index.php index dd111af766..8bd0de5e60 100644 --- a/tests/resources/functions/php/index.php +++ b/tests/resources/functions/php/index.php @@ -10,6 +10,6 @@ return function ($request, $response) { 'APPWRITE_FUNCTION_RUNTIME_VERSION' => $request['env']['APPWRITE_FUNCTION_RUNTIME_VERSION'], 'APPWRITE_FUNCTION_EVENT' => $request['env']['APPWRITE_FUNCTION_EVENT'], 'APPWRITE_FUNCTION_EVENT_DATA' => $request['env']['APPWRITE_FUNCTION_EVENT_DATA'], - 'UNICODE_TEST' => "êä" // TODO: Re-add unicode test to FunctionsCustomServerTest.php + 'UNICODE_TEST' => "êä" ]); };