diff --git a/app/config/runtimes.php b/app/config/runtimes.php index 519db407a5..b3acd25fd0 100644 --- a/app/config/runtimes.php +++ b/app/config/runtimes.php @@ -8,12 +8,8 @@ use Appwrite\Runtimes\Runtimes; */ $runtimes = new Runtimes(); -$allowList = empty(App::getEnv('_APP_FUNCTIONS_ENVS')) ? false : \explode(',', App::getEnv('_APP_FUNCTIONS_ENVS')); +$allowList = empty(App::getEnv('_APP_FUNCTIONS_ENVS')) ? [] : \explode(',', App::getEnv('_APP_FUNCTIONS_ENVS')); -$runtimes = array_filter($runtimes->getAll(), function ($key) use ($allowList) { - $isAllowed = $allowList && in_array($key, $allowList); - - return $allowList ? $isAllowed : true; -}, ARRAY_FILTER_USE_BOTH); +$runtimes = $runtimes->getAll(filter: $allowList); return $runtimes; \ No newline at end of file