Support using pipe characters within egg validation rules; closes #1960
This commit is contained in:
parent
69eb33fb89
commit
49dee28eb8
1 changed files with 6 additions and 1 deletions
|
@ -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') ?? [];
|
||||
|
|
Loading…
Reference in a new issue