From bad9ae58e84bb37c2775b4ca1917b8ff57b2a07a Mon Sep 17 00:00:00 2001 From: Sergzy Date: Sat, 30 Jun 2018 22:25:40 +0200 Subject: [PATCH] Fix environment_variables name (#1212) --- CHANGELOG.md | 1 + app/Services/Servers/EnvironmentService.php | 2 +- tests/Unit/Services/Servers/EnvironmentServiceTest.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b1142c87..0e397ace2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines. * Hitting Ctrl+Z when editing a file on the web now works as expected. * Logo now links to the correct location on all pages. * Permissions checking to determine if a user can see the task management page now works correctly. +* Fixed `pterodactyl.environment_variables` to be used correctly for global environment variables. The wrong config variable name was being using previously. ### Changed * Attempting to upload a folder via the web file manager will now display a warning telling the user to use SFTP. diff --git a/app/Services/Servers/EnvironmentService.php b/app/Services/Servers/EnvironmentService.php index 85eb69bb8..b17076e07 100644 --- a/app/Services/Servers/EnvironmentService.php +++ b/app/Services/Servers/EnvironmentService.php @@ -78,7 +78,7 @@ class EnvironmentService } // Process variables set in the configuration file. - foreach ($this->config->get('pterodactyl.environment_mappings', []) as $key => $object) { + foreach ($this->config->get('pterodactyl.environment_variables', []) as $key => $object) { if (is_callable($object)) { $variables[$key] = call_user_func($object, $server); } else { diff --git a/tests/Unit/Services/Servers/EnvironmentServiceTest.php b/tests/Unit/Services/Servers/EnvironmentServiceTest.php index 0f7000209..acce1c683 100644 --- a/tests/Unit/Services/Servers/EnvironmentServiceTest.php +++ b/tests/Unit/Services/Servers/EnvironmentServiceTest.php @@ -12,7 +12,7 @@ use Pterodactyl\Contracts\Repository\ServerRepositoryInterface; class EnvironmentServiceTest extends TestCase { - const CONFIG_MAPPING = 'pterodactyl.environment_mappings'; + const CONFIG_MAPPING = 'pterodactyl.environment_variables'; /** * @var \Illuminate\Contracts\Config\Repository|\Mockery\Mock