mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-10 02:13:44 +02:00
Support using pipe characters within egg validation rules; closes #1960
This commit is contained in:
@@ -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') ?? [];
|
||||
|
||||
Reference in New Issue
Block a user