From 49dee28eb8a15b2e072cfbea3a86d2e7d84f0522 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Thu, 7 May 2020 20:40:19 -0700 Subject: [PATCH] Support using pipe characters within egg validation rules; closes #1960 --- app/Services/Eggs/Variables/VariableUpdateService.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Services/Eggs/Variables/VariableUpdateService.php b/app/Services/Eggs/Variables/VariableUpdateService.php index 910b50f05..da1a9e987 100644 --- a/app/Services/Eggs/Variables/VariableUpdateService.php +++ b/app/Services/Eggs/Variables/VariableUpdateService.php @@ -2,6 +2,7 @@ namespace Pterodactyl\Services\Eggs\Variables; +use Illuminate\Support\Str; use Pterodactyl\Models\EggVariable; use Illuminate\Contracts\Validation\Factory; use Pterodactyl\Exceptions\DisplayException; @@ -81,7 +82,11 @@ class VariableUpdateService } if (! empty($data['rules'] ?? '')) { - $this->validateRules($data['rules']); + $this->validateRules( + (is_string($data['rules']) && Str::contains($data['rules'], ';;')) + ? explode(';;', $data['rules']) + : $data['rules'] + ); } $options = array_get($data, 'options') ?? [];